Notice: Kling 4.0 is here: text-to-video and image-to-video are 20% off for a limited time. Try it now
HiAPI
Tutorials

MCP one-click

HiAPI Remote MCP lets Claude, ChatGPT, Codex and other AI clients generate images, videos, and audio through HiAPI.

Choose your AI tool

Send this prompt to Codex

Paste it into the chat inside this client; it configures the connection and starts the authorization for you.

  1. 1 Click "Copy prompt"
  2. 2 Paste it into Codex and send
  3. 3 Your browser opens HiAPI's approval page: sign in, pick a quota and approve
Please connect HiAPI MCP in the environment I actually use. Call out every step I have to do myself (clicking a button in the client, approving in the browser) — that's all I'll do; don't ask me to paste commands, codes, or callback URLs.

Target client: Codex
Server name: hiapi
MCP URL: https://mcp.hiapi.ai/mcp (Streamable HTTP + OAuth)

Do these in order:
1. Confirm you are Codex and state the environment evidence you relied on (the platform, and whether your own config or plugin directory exists) — a self-declaration isn't enough. Do all the setup below in the environment you actually run in (macOS / Linux / Windows / WSL, local or remote server).
2. Run `codex mcp get hiapi` first. Only if it doesn't exist, run: `codex mcp add hiapi --url https://mcp.hiapi.ai/mcp --oauth-client-id hiapi-codex`. If it already exists with the same URL, keep it.
3. Codex opens the browser for approval right after adding; wait for me to finish. If it doesn't, or `codex mcp list` still shows hiapi as not logged in, run `codex mcp login hiapi` and wait for me to approve in the browser. The HiAPI approval page opens next, where I'll sign in, approve, and set a quota; if the browser can't open, give me the link as described above. Start sign-in at most once.
4. After approval, call hiapi's get_balance to confirm it works; if the call fails, you may retry once, and if it fails again, stop and show me the exact error. Don't call any tool that costs money (image, video, audio, or text generation). If this session can't see hiapi's tools yet, ask me to restart it instead of signing in again.
5. Keep other entries when editing config files, and never print access tokens, authorization codes, code_verifier, or other credentials in chat, logs, or command echo.
6. When done, report briefly in two parts. What you verified yourself: which config you changed (a file or an in-app setting; say so if it was already there and left alone), and the balance check result with the balance. What I need to confirm: whether I approved in the browser, and whether I need to restart the client.

If what you find differs only slightly from these steps (for example the config file doesn't exist yet, or an existing entry is formatted a little differently), go with what's actually there and point out each deviation in your report. If a screen or setting isn't there, a command doesn't exist, you aren't the client named above, or a change outside these steps would be needed, stop and tell me what you see instead of guessing another way.
Report only what you actually did and saw. For my side (for example, whether I approved in the browser), if you can't see it, write "waiting for you to confirm" instead of calling it done.

Manual setup

Prefer to edit it yourself? Copy the commands or file contents below.

Server URL
https://mcp.hiapi.ai/mcp
Add
codex mcp add hiapi --url https://mcp.hiapi.ai/mcp --oauth-client-id hiapi-codex
Sign in
codex mcp login hiapi

Common issues

The client can't connect
Check that the URL is https://mcp.hiapi.ai/mcp and the transport is HTTP (Streamable).
Results are not ready yet
The task is still running. Ask the AI to keep checking with the same task_id instead of submitting again.

Manage connected apps