Skip to content
English

MCP

HiAPI provides a hosted remote MCP (Model Context Protocol) server. After connecting, any MCP-compatible client — including Claude Code and Cursor — can call image, video, audio, and text generation tools. Media tools use the Unified Async API, while text tools use OpenAI-compatible text endpoints. No local deployment is required.

https://mcp.hiapi.ai/mcp

The server is stateless about credentials: it never stores your API key, it only forwards the Authorization header of each request to api.hiapi.ai.

Authentication uses your HiAPI API key as a Bearer token. Create one at Dashboard → API Keys.

Terminal window
claude mcp add --transport http hiapi https://mcp.hiapi.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY"

After connecting, the client discovers the available tools and invokes the corresponding capability, such as an image-generation or product-description request.

ToolWhat it doesDefault model
generate_imageText-to-image, plus reference-image generation on models that support itgpt-image-2.5-sunburst/text-to-image; gpt-image-2.5-sunburst/image-to-image with reference images
edit_imageEdit or transform an existing image (image-to-image)gpt-image-2.5-sunburst/image-to-image
generate_videoText-to-video and image-to-videoseedance-2.5: text-to-video, image-to-video, or reference-to-video, picked from the inputs
generate_audioDialogue speech, music, and other live audio modelselevenlabs/text-to-dialogue
generate_textGenerate text with any live text model; the catalog selects Chat or Responsesgpt-6-astra
get_task_statusCheck an asynchronous image, video, or audio task by ID—
list_modelsList all live image, video, audio, and text models with capability summaries and published routes—
get_model_capabilitiesPer-model parameters: aspect ratios, resolutions, output formats, reference-image limits, durations—
get_model_schemaPublished parameter schema of any model: field names, types, required flags, allowed values, defaults, limits, endpoint type, and available routes (pass route to see that route’s fields); free and read-only—
get_pricingLive pricing metadata from /api/pricing—
estimate_priceEstimate the USD cost from live public pricing without generating anything, using the same model, route, and input as POST /v1/tasks, including active promotions—
upload_fileUpload an input image, audio, or video before generation and get a temporary HTTPS URL (deleted after 24 hours)—
get_balanceRead the quota, usage, and total allowance of the API key in use—

Image, video, and audio tools only submit a task through POST /v1/tasks and return its task_id right away; they never wait for the result, because MCP clients abandon a tool call after 30–60 seconds. Your AI then polls get_task_status with that ID (or you call the task detail endpoint): images and audio usually finish in 10–60 seconds, videos in 1–5 minutes. Don’t resubmit while a task is running — every submission is a new, separately charged task. To retry safely after a timeout or dropped connection, pass idempotency_key to generate_image, edit_image, generate_video, or generate_audio and reuse the same key on the retry: HiAPI then returns the original task instead of charging twice. Text models use the live catalog’s /v1/chat/completions or /v1/responses route. generate_text is synchronous: it returns the complete reply in one call (long or reasoning-heavy replies can take minutes) and reports a clear error when stream: true is requested. Every call is billed for the tokens it generates, even if the client times out or cancels, so don’t repeat a timed-out call with the same input.

Supported models match the live public catalog — see the model pages for exact parameters. Model-specific fields (for example Seedance reference videos, Wan ratio, FLUX safety_tolerance, or audio lyrics) go inside input, under the names the model page and get_model_schema use; the old params field still works but is no longer recommended. Models from a modality without a matching MCP tool are shown separately until support is added.

The media generation tools take the same body as POST /v1/tasks: model, route, input, callback, storage, plus idempotency_key, so any REST example works as-is. Convenience top-level fields (prompt, aspect_ratio, …) are still accepted and are the same REST names.

route picks a route such as ext, beta, or pro. For gpt-image-2.5 pro, send model gpt-image-2.5-flare (or gpt-image-2.5-sunburst) with route: "pro"; the legacy @suffix spelling still works. get_model_schema lists the available routes and, given route, shows that route’s own fields; list_models prints the routes at the end of each row. See Model routes.

A model or route outside the public catalog (only open to some accounts) is no longer rejected by MCP — it is submitted verbatim and the backend decides, returning its own error when you lack access.

Alongside the text output, the generation tools and get_task_status return structuredContent equal to the REST data (generation tools add idempotent_replay).

SymptomFix
401 / 403 from toolsCheck the Authorization: Bearer … header in your client config
Balance or quota errorsAdd funds at Dashboard → Billing
Result not ready yetThe task is still running — keep calling get_task_status with the same task_id; don’t submit the generation again
Client cannot connectVerify the URL is exactly https://mcp.hiapi.ai/mcp and the transport is HTTP (streamable)

For model-specific workflows in an agent runtime, install Skills. For product or backend integration, call the Unified Async API directly.