Notice: MAI Image 2.7 launch limited-time 20% off, covering the full text-to-image and image editing lineup, try it now
Notice: Black Friday 2026 × Cyber Monday: Get up to 30% extra on top-ups, DeepSeek free to use · View the promotion
Open navigation

Connect and integrate

HiAPI has two families of API surface. Pick the one your workload needs — most products end up using both.

Text reasoning

For chat, reasoning, structured output, and tool calls, point an OpenAI-compatible client at HiAPI and keep your existing code.

OptionWhen to use
Responses — POST /v1/responsesRecommended for new text integrations: reasoning controls, structured output, built-in tools.
Chat Completions — POST /v1/chat/completionsExisting OpenAI SDK code — change base_url and keep everything else.
from openai import OpenAI

client = OpenAI(base_url="https://api.hiapi.ai/v1", api_key="YOUR_API_KEY")
resp = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Explain sparse attention."}],
)
print(resp.choices[0].message.content)

Media generation

Image, video, and audio models all run on one asynchronous task API: submit, then poll or wait for a callback, then read the output URL.

curl -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "happyhorse-1.0", "input": {"prompt": "a cyan glass data center entrance", "duration": 5, "resolution": "720p"}}'

Let an agent write the call

If you are integrating through an AI coding tool rather than writing HTTP by hand:

  • Agent Skills — install a skill into Claude Code, Codex, or OpenClaw; the agent applies the documented model parameters. Skills
  • Remote MCP — connect an MCP client to https://mcp.hiapi.ai/mcp with your API key; the agent calls the tools directly. MCP
  • Official SDKs — zero-dependency clients for Python, Go, Java, and Node.js. SDK

Before production

  • Authentication — API keys, scopes, and keeping them out of client code.
  • Rate limits — the two buckets and how to back off on 429.