Generate images
Text to image, edits with reference images, aspect ratio and count.
Use ToAPIs to generate a 16:9 image of a lighthouse at dawn
Tool: generate_image
Connect ToAPIs to the agents you already use through MCP. Clients that support browser sign-in need no API key copied. The agent picks the model, reads its parameters, submits the job and brings back the result.
Connect
MCP endpoint
https://api.toapis.cn/mcp
This client only supports a key in a request header. Create a key in the ToAPIs console, preferably with a spending limit, and copy it. Replace <API_KEY> in the configuration below with this key.
Open API TokensOpen the Doubao desktop app, click "插件·技能·伙伴" (Plugins, Skills, Partners) in the left sidebar, click "+ 添加" (Add) at the top right of the "插件" (Plugins) page and choose "新建自定义插件" (New custom plugin). Enter ToAPIs as the server name, choose HTTP as the transport type and enter the URL below as the server URL.
https://api.toapis.cn/mcpUnder "自定义 Headers" (Custom headers), click "+ 添加" (Add). Enter Authorization as the header name and the line below as the value (replace <API_KEY> with your key), then click "保存" (Save).
Bearer <API_KEY>Add it in the Doubao desktop app (Windows or macOS). For enterprise accounts, whether custom plugins are allowed depends on the administrator's settings.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnThis client only supports a key in a request header. Create a key in the ToAPIs console, preferably with a spending limit, and copy it. Replace <API_KEY> in the configuration below with this key.
Open API TokensIn QwenWork, open "扩展" (Extensions) → "连接器" (Connectors) in the left sidebar, click "+ 添加" (Add) → "粘贴 JSON 配置" (Paste JSON) at the top right, paste the configuration below (replace <API_KEY> with your key) and click "导入" (Import).
{
"mcpServers": {
"toapis": {
"type": "streamable-http",
"url": "https://api.toapis.cn/mcp",
"headers": {
"Authorization": "Bearer <API_KEY>",
"X-Locale": "en"
}
}
}
}Connectors are off by default. Turn on toapis in the connector list, then start a new task. It does not work in existing conversations.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnThe first command installs the ToAPIs skills (needs Node.js; MCP works without them). The second adds the ToAPIs MCP server:
npx skills add toapis/skills -g --agent qwen-code -y
qwen mcp add --scope user --transport http toapis https://api.toapis.cn/mcp --header "X-Locale: en"Run qwen to start Qwen Code. When it connects to ToAPIs, it opens the authorization page in your browser: sign in, choose a key and click Allow. Type /mcp in Qwen Code to check the connection and sign-in status of toapis.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnCreate a key under "API Tokens" in the console, replace <API_KEY> in the command below with it and run the command.
qwen mcp add --scope user --transport http toapis https://api.toapis.cn/mcp --header "Authorization: Bearer <API_KEY>" --header "X-Locale: en"This client only supports a key in a request header. Create a key in the ToAPIs console, preferably with a spending limit, and copy it. Replace <API_KEY> in the configuration below with this key.
Open API TokensIn Trae, open "设置" (Settings) > "MCP". In the "MCP Servers 管理" (MCP Servers) section, click "添加" (Add) > "手动添加" (Add manually) at the top right, paste the configuration below (replace <API_KEY> with your key) and click "确认" (Confirm).
{
"mcpServers": {
"toapis": {
"url": "https://api.toapis.cn/mcp",
"headers": {
"Authorization": "Bearer <API_KEY>",
"X-Locale": "en"
}
}
}
}They help the agent pick models and write prompts (needs Node.js; MCP works without them):
npx skills add toapis/skills -g --agent trae-cn -yStart a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnIn WorkBuddy, open Connectors from the sidebar, click Custom connector in the top right, paste the configuration below and save.
{
"mcpServers": {
"toapis": {
"type": "http",
"url": "https://api.toapis.cn/mcp"
}
}
}Click Trust and Connect, then sign in on the ToAPIs page that opens, choose an API key and click Allow.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnClaude Code asks before it runs each command. Allow them.
Set up ToAPIs in Claude Code for image and video generation.
1. Install the ToAPIs skills: `npx skills add toapis/skills -g --agent claude-code -y` If npx is not found, first install Node.js LTS (it includes npx) in the standard way for this system. If npx is still not found after that, run it from the Node.js install directory by its full path. If Node.js cannot be installed (for example an administrator password is needed or the install is blocked), skip this step and continue, then remind me at the end to install the skills after installing Node.js.
2. Add the ToAPIs MCP server: `claude mcp add --transport http --scope user toapis https://api.toapis.cn/mcp --header "X-Locale: en"`
3. Tell me to type /mcp, select toapis and authorize it in the browser (restart Claude Code first if toapis is not listed). When I tell you I am done, run `claude mcp list` and confirm that toapis shows Connected; if it does not, tell me what it shows and help me fix it.Type /mcp in Claude Code, select toapis and sign in in the browser. If toapis is not listed, restart Claude Code first.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnClick Add, then Connect. Sign in on the ToAPIs page, choose an API key and click Allow.
Claude reaches ToAPIs from Anthropic's servers, so do not pick a key with an IP allowlist. The Free plan allows one custom connector.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnOpen Settings, then Connectors, and add a custom connector. Name it ToAPIs, use the URL below, and leave the OAuth client ID and secret empty.
https://api.toapis.cn/mcpSwitch to Full access
By default Codex does not let the agent change settings outside the workspace. Switch this chat's permission mode to Full access, and switch it back after the setup.
The Codex CLI and desktop app share one configuration, so one setup covers both.
Set up ToAPIs in Codex for image and video generation.
1. Install the ToAPIs skills: `npx skills add toapis/skills -g --agent codex -y` If npx is not found, first install Node.js LTS (it includes npx) in the standard way for this system. If npx is still not found after that, run it from the Node.js install directory by its full path. If Node.js cannot be installed (for example an administrator password is needed or the install is blocked), skip this step and continue, then remind me at the end to install the skills after installing Node.js.
2. Add the ToAPIs MCP server: `codex mcp add toapis --url https://api.toapis.cn/mcp`. Newer Codex versions open the browser sign-in right after adding and wait until it finishes: tell me to sign in and click Allow in the browser, then wait for the command to finish.
3. Check the sign-in: run `codex mcp list`; if the Auth column for toapis shows OAuth, it worked. If it shows Not logged in, run `codex mcp login toapis`, again tell me to finish in the browser, and check again after the command finishes. If a command times out before I finish, wait until I tell you I am done, then run `codex mcp list` again.
If a command is blocked because it writes outside the workspace, stop and tell me.
Finally tell me the result: if it worked, remind me to start a new chat to use it; if not, tell me which step failed.Codex opens the ToAPIs authorization page. Sign in, check the client name, choose an API key or create a dedicated one with a spending limit, and click Allow. In the desktop app you can also click Authenticate next to toapis under Settings, MCP servers.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnnpx skills add toapis/skills -g --agent codex -y
codex mcp add toapis --url https://api.toapis.cn/mcp
codex mcp list
# If the Auth column for toapis shows "Not logged in", run: codex mcp login toapisClick the button and confirm in Cursor, or paste the configuration below into ~/.cursor/mcp.json.
Add to CursorIn Cursor's MCP settings, click Connect next to toapis, sign in to ToAPIs in the browser, choose an API key and click Allow.
They help the agent choose models and write prompts. This needs Node.js; without it, MCP still works:
npx skills add toapis/skills -g --agent cursor -yStart a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawn{
"mcpServers": {
"toapis": {
"url": "https://api.toapis.cn/mcp",
"headers": {
"X-Locale": "en"
}
}
}
}Devin Desktop and Devin CLI share one configuration. Run these commands in a terminal, or ask Devin to run them:
devin mcp add -s user toapis https://api.toapis.cn/mcp
devin mcp login toapisdevin mcp login toapis opens the browser: sign in to ToAPIs, choose an API key and click Allow. If you skip it, Devin asks you to sign in the first time it uses toapis.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnThe Antigravity app, IDE and CLI share ~/.gemini/config/mcp_config.json. Merge the configuration below and save it, then type /mcp in the CLI or reload the servers in settings.
{
"mcpServers": {
"toapis": {
"serverUrl": "https://api.toapis.cn/mcp",
"headers": {
"X-Locale": "en"
}
}
}
}Open Antigravity settings with Cmd + , (Ctrl + , on Windows), go to Customizations and click Authenticate next to toapis. After you sign in to ToAPIs and click Allow, the page shows an authorization code. Paste it into settings and click Submit.
Start a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnAdd a remote MCP server (Streamable HTTP) with the URL below and choose OAuth sign-in. Leave the client ID and secret empty.
https://api.toapis.cn/mcpSome clients only support header authentication or cannot complete the browser sign-in. Create a dedicated API key in the console and connect with an Authorization: Bearer header.
API key setup guideStart a new chat and send the question below. If it shows your balance, the connection works (checking is free). If it asks you to sign in, fails authentication or cannot find the ToAPIs tools, go back and check the steps above.
How many ToAPIs credits do I have left, and how much did I spend today?Describe the image or video you want, for example:
Use ToAPIs to generate a 16:9 image of a lighthouse at dawnCapabilities
Describe what you want in plain words. The agent picks a model, prepares the parameters from its docs, submits the job and follows it up.
Text to image, edits with reference images, aspect ratio and count.
Use ToAPIs to generate a 16:9 image of a lighthouse at dawn
Tool: generate_image
Text to video and image to video, with Seedance recommended by default.
Turn this product photo into a 5-second vertical promo video
Tool: generate_video
Give the path of a local image. The agent uploads it and uses it as a reference.
Use ./product.png as a reference and put the product on a white background
Tool: create_upload
Balance, recent tasks, why a task failed, and what you spent today.
How many ToAPIs credits do I have left, and how much did I spend today?
Tool: get_balance / get_usage
Why MCP
Clients such as Qwen Code and WorkBuddy sign in through your browser. The connection uses the key you choose, and the key never appears in the agent's configuration or chat.
Create a dedicated key with a spending limit for the connection, and disconnect any time under Connected apps in the console.
Usage is billed at the normal model prices from your credits, and failed tasks are refunded under the usual rules.
GPT Image, Nano Banana, Seedance, Kling and 200+ other models, with new models available as soon as they launch.
Curated high-frequency questions. Click any question to expand the answer. Use the button below to rotate questions.
You do not copy one. When you authorize, you pick an existing key on the ToAPIs page or create a dedicated one, and the agent uses it through an access token. Clients that only support header authentication can connect with an API key instead.
The same as calling the API: model prices are deducted from the chosen key and your account credits. Listing models, checking the balance and looking up tasks are free. Only image and video generation is charged.
Installing the skills and adding the MCP server writes to the Codex configuration on your computer, and the default permission mode stops the agent from changing files outside the workspace. You only need it for the setup and can switch back afterwards, or run the commands in a terminal yourself.
Disconnect it under Connected apps in the console. This revokes the authorization and disables a dedicated key created for the connection, unless another connection still uses it. Removing toapis in the client, for example with codex mcp remove toapis, only deletes the local configuration.
The two sites have separate accounts and credits. Accounts on toapis.com use api.toapis.com/mcp, and accounts on toapis.cn use api.toapis.cn/mcp. Signing in on the other site shows a site mismatch.
Most desktop and command-line clients that support remote MCP with OAuth can connect as described under Other clients. If a client's sign-in fails, connect it with an API key instead. We will keep adding steps for more clients.
Sign up to get started, then generate images and videos right in the chat.