Эксплуатация
Generate image assets from Codex with API Hubs
Connect Codex to API Hubs over MCP and add a generated image to your app with an estimate, spending ceiling and resumable task.
Codex
codex mcp add apihubs --url https://api.apihubs.ru/mcpcodex mcp login apihubsmcp.connectCodexHint
Ask Codex to create an image for the app it is editing. API Hubs supplies media-generation tools over MCP. Codex's coding model and its existing file-editing permissions stay under your control.
Connect Codex
Run the add and login commands above. If the add command already starts authentication, complete that flow. Otherwise the login command opens browser sign-in. Review the requested access on API Hubs.
Codex CLI and its IDE extension share MCP configuration. Restart the
session after setup. Use /mcp in the terminal interface to check the
server, or codex mcp list in your shell to inspect configured entries.
Use a current client version. This is a remote MCP tool connection, so you do not need to change Codex's model provider or enter an API key in the MCP configuration.
Check the tools first
Use the API Hubs MCP tools to call get_account and list_models.Report the balance and available image models. Do not generate anything.
An entry in the configuration proves only that the entry was saved. Authenticated tool calls establish account access; a successful generation is a separate step.
Add one image to an existing screen
Use the app asset brief.
It asks Codex to quote one image, wait for approval, retrieve the completed
file and integrate it into an existing screen. Inspect the model with
get_model; public input parameters differ between models.
For an approved generation, set maxCostUsd and retain the
idempotencyKey and returned task id. Retry the same logical submission
with the same key after an uncertain response. Poll get_task until
completion before downloading its result.
Save the download in the project without forwarding API Hubs OAuth credentials to its file URL. A returned remote task id is not a local image. Ask Codex to report the changed file and the terminal task status.
Resume or disconnect
After restarting Codex, supply the saved task id and ask it to inspect that task before starting anything new. Stopping your local session does not cancel an accepted remote request.
If sign-in expires, repeat the login command. You can revoke access in Dashboard → Connectors. Read the MCP reference for tool scopes.
Setup follows the official Codex MCP documentation. Local protocol checks do not establish that every model or a paid production workflow works in your environment.

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