Эксплуатация
Generate images in Claude Code with API Hubs
Add API Hubs media tools to Claude Code, check access and create a landing-page illustration with a request spending ceiling.
Claude Code
claude mcp add --transport http apihubs https://api.apihubs.ru/mcpmcp.connectHint
Give Claude Code a page-building task that includes an original image. API Hubs's MCP server lets it inspect models, quote a generation and retrieve the finished media. Claude Code keeps using your selected coding model.
Connect the media tools
Run the command above from the project where you want the connection.
Inside Claude Code, open /mcp, select apihubs and authenticate.
Sign in to API Hubs in the browser and review the requested permissions.
The connection uses OAuth; keep account credentials out of project files.
You can alternatively install the existing Claude Code plugin:
/plugin marketplace add APIHubsRU/apihubs-mcp/plugin install apihubs@apihubs
Use either setup method. Adding both creates duplicate connections.
Check access without generating media
Use the API Hubs MCP tools to call get_account and list_models.Show my balance and three image models. Do not create a generation.
Discovery can list tool schemas before sign-in. Actual tool calls need
authentication. Seeing the server name in /mcp does not prove that
generation permissions or sufficient balance are available.
Create a hero image and use it in a page
Copy the landing-page brief. The workflow inspects a model, quotes the exact input, waits for spending approval and retrieves the finished task. Claude Code then uses its local file tools to place the image in the project.
Use the approved quote as maxCostUsd. Generate an idempotencyKey once
for this logical task and reuse it if the connection drops after submission.
A new key may create another billable task. Stopping Claude Code does not
cancel an accepted generation.
For a reference image, call create_upload_url, upload the file with HTTP
PUT and use the returned publicUrl in the model input. The upload and
download require HTTP-capable local tools; MCP alone does not write your
project files.
Review the result
Require a finished task, an actual local image and an evidence record with the model and task id. Inspect the page before publishing it. A request quote is an estimate; report a charged amount only when it was observed.
Revoke the connection in Dashboard → Connectors. For a second task, try the app asset brief or inspect video models.
Troubleshooting
| Symptom | Next step |
|---|---|
| Tools are missing | Check /mcp, authenticate and start a new session. |
| A tool returns unauthorized | Repeat browser sign-in and review consent. |
| Creation is refused | Check balance, generation permission, model input and the spending ceiling. |
| A task is still processing | Keep its id and poll it; avoid creating a replacement task. |
Setup follows Claude Code's MCP documentation. Protocol checks and connection setup are separate from a paid end-to-end generation. The MCP reference describes each tool and its permissions.

Запустите это со своим ключом
Выберите модель в каталоге API Hubs, проверьте цену и попробуйте её в браузере или через API.