- Home
- Documentation
Documentation
Sakuranbo AI is a developer API for text, image, and video generation models. One catalog, one error format, and one prepaid USD balance cover every model.
Use the OpenAI SDK
Section titled “Use the OpenAI SDK”Sakuranbo AI works with the OpenAI SDKs. To try it with code that already calls the OpenAI API, change the base URL to https://api.sakuranbo.ai/v1 and the API key to your Sakuranbo AI key. Set model to a Sakuranbo AI model ID, as in the examples.
curl -X POST "https://api.sakuranbo.ai/v1/chat/completions" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $SAKURANBO_API_KEY" \ -d '{ "model": "sakuranbo/cherrytext-1.0-flash", "messages": [ { "role": "system", "content": "You are a concise assistant." }, { "role": "user", "content": "Summarize the benefits of prepaid API credits in two lines." } ], "max_tokens": 2048}'import OpenAI from "openai";
const apiKey = process.env.SAKURANBO_API_KEY;if (!apiKey) throw new Error("Set the SAKURANBO_API_KEY environment variable.");
const client = new OpenAI({ baseURL: "https://api.sakuranbo.ai/v1", apiKey,});
const completion = await client.chat.completions.create({ model: "sakuranbo/cherrytext-1.0-flash", messages: [ { role: "system", content: "You are a concise assistant." }, { role: "user", content: "Summarize the benefits of prepaid API credits in two lines." } ], max_tokens: 2048});
console.log(completion.choices[0]?.message.content);import os
from openai import OpenAI
client = OpenAI( base_url="https://api.sakuranbo.ai/v1", api_key=os.environ["SAKURANBO_API_KEY"],)
completion = client.chat.completions.create( model="sakuranbo/cherrytext-1.0-flash", messages=[ { "role": "system", "content": "You are a concise assistant.", }, { "role": "user", "content": "Summarize the benefits of prepaid API credits in two lines.", }, ], max_tokens=2048,)
print(completion.choices[0].message.content)The TypeScript and Python examples use the official OpenAI SDK. The examples read the API key from the environment variable SAKURANBO_API_KEY and use the model sakuranbo/cherrytext-1.0-flash. To create a key, follow the Quickstart. For the Anthropic SDKs and the other chat features, see Chat.
Get started
Section titled “Get started”- Quickstart: create an account and an API key, add balance, and send your first chat request.
- Authentication: how requests are authenticated with an API key.
Guides
Section titled “Guides”- Chat: generate text with the OpenAI-compatible and Anthropic-compatible endpoints, with streaming.
- Images: generate and edit images.
- Videos: generate videos from text, a first frame, or reference images.
- Jobs: track, list, and cancel image and video jobs.
- Webhooks: receive job, deposit, and low-balance events, and verify their signatures.
- Balance and key limits: read your balance and the spending limit of an API key.
Reference
Section titled “Reference”- Models API:
GET /v1/modelsandGET /v1/models/{vendor}/{model}. - Estimate API:
POST /v1/estimate. - Errors: the error format, HTTP status codes, and every error code.
- Pricing and billing: prepaid balance, deposits, unit prices, and what is not billed.
- MCP server: connect coding agents to search the docs, browse models, estimate costs, and read your balance and history.
For tools and agents
Section titled “For tools and agents”- OpenAPI 3.1 definition
- Interactive API reference
- llms.txt: a short index for LLMs and agents.
All prices are in USD. Listed prices include our margin.