New: Nano Banana 2.1Try the model
API Stock

Operations

Connect Cursor to API Stock

Add image, video and music generation to Cursor through MCP, or configure a chat model with your API key.

3 min read5 sections

mcp.connectCursorTitle

mcp.connectCursorButton

mcp.connectCursorHint

mcp.connectCursorManual
{ "mcpServers": { "api-stock": { "url": "https://api.api-stock.com/mcp" } } }

Use Cursor to create illustrations for a page, generate a short product clip or prepare music for a prototype. Connect API Stock as an MCP server and keep the coding model you already use in Cursor.

You can also route compatible chat requests through your API Stock key. The two connections are configured separately.

What you wantConnectionAuthentication
Generate images, video or music from CursorRemote MCP toolsBrowser sign-in and consent.
Use a chat model from the catalogCustom OpenAI-compatible base URLAPI Stock API key.

Add the media tools

Use Add to Cursor above and review the server URL before installing. Alternatively, merge this entry into .cursor/mcp.json in your project, preserving other servers. For all projects, use ~/.cursor/mcp.json:

json
{
"mcpServers": {
"api-stock": {
"url": "https://api.api-stock.com/mcp"
}
}
}

Open Cursor's MCP settings, enable the server and follow its sign-in prompt. In the browser, sign in to API Stock and review the requested permissions. The configuration contains no API key or client secret; Cursor manages the OAuth credentials after approval.

Use a current Cursor version. Its documented callbacks are http://localhost:8787/callback and https://www.cursor.com/agents/mcp/oauth/callback. The desktop callback cursor://anysphere.cursor-mcp/oauth/callback is also supported. The cursor:// installation link above opens the app at a different address and is separate from the OAuth callback.

Check the connection without a charge

Open a new Agent chat and ask:

text
Use the API Stock MCP tools to call get_account and list_models.
Show my balance and three image models. Do not create a generation.

These tools read account and catalog data without starting a paid task. If tools are missing, check that the server is enabled and authenticated, and that your Cursor mode supports MCP tools.

Create an illustration for a page

text
Create one illustration for this page: a paper boat on a rainy street,
portrait composition, no lettering. First use get_model to inspect the
image model's parameters, then estimate_cost with the final input.
Show me the quote and wait for my approval before create_generation.
Use the approved amount as maxCostUsd and an idempotencyKey for this
specific task. Use get_task to wait for completion and return the file URL.

The quote does not create a task. create_generation spends your balance; maxCostUsd makes the server reject a request above your ceiling. Reuse the same idempotency key if retrying the same submission after a connection failure. Use a new key when you intentionally want another result.

For an input file, ask the agent to call create_upload_url, upload the bytes with HTTP PUT and pass its publicUrl to the model. The upload needs an HTTP-capable tool alongside MCP. A returned taskId means the request was accepted; use the completed task's result URL for the finished asset.

Disconnect access at any time in Dashboard → Connectors. Read the MCP reference for tools, upload limits and scopes.

Configure a chat model separately

Create an API key and open Cursor Settings → Models. In API Keys, enter that key under OpenAI API Key and enable it. If your version exposes Override OpenAI Base URL, set it to:

text
https://api.api-stock.com/api/v1

Add a custom model with its exact id from the chat catalog or GET /api/v1/models. Choose an id that does not start with claude-: Cursor selects the Anthropic key slot for that prefix, so this OpenAI-key setup will not authenticate those models. Enable the model and select it in a new chat. Start with a small request and check the charge in your dashboard.

API Stock exposes /api/v1/chat/completions and /api/v1/messages. It does not expose /api/v1/responses. Cursor modes or models that require Responses API will not work through this base URL. Chat connectivity alone does not establish Agent compatibility. Use MCP media tools with your existing Cursor coding model when that mode needs Responses API.

Custom keys do not replace Cursor Tab. Cursor routes custom-key requests through its backend; check its data policies and plan terms. When returning to Cursor-managed models, disable the custom key and base URL override if they still route requests to API Stock.

Troubleshooting

SymptomWhat to check
Install link does not openOpen this page on the computer with Cursor installed, or use the JSON configuration.
Sign-in failedUpdate Cursor, check its callback address and restart authentication.
Cannot create mediaCheck mcp:generate consent, balance and maxCostUsd.
Chat request returns 404Check the /api/v1 base URL and whether Cursor requested /responses.
Model not foundCopy the exact active model id from the catalog and select it explicitly.

References: Cursor MCP, install links, custom keys and Cursor protocol requirements. See also Cursor support on model-name routing.

Run this with your own key

Choose a model in the API Stock catalog, check its price and try it in your browser or through the API.

Keep reading