U9 AI · DOCUMENTATION
API addresses & compatibility
Choose the correct protocol and distinguish model discovery from generation.
Download Markdown ↓Addresses and authentication#
Use HTTPS and your U9 API key as Authorization: Bearer. The base URL ends in /v1 for OpenAI-compatible clients. Do not append /v1 twice. Claude Code uses the root URL instead; it adds /v1/messages itself.
| API | URL |
|---|---|
| Models · GET | https://u9ai.ai/v1/models |
| Chat Completions · POST | https://u9ai.ai/v1/chat/completions |
| Responses · POST | https://u9ai.ai/v1/responses |
| Anthropic Messages · POST | https://u9ai.ai/v1/messages |
Choose a protocol, not just a model name#
A model listed in GET /v1/models is not a guarantee that it supports every endpoint. Chat Completions compatibility does not prove Responses compatibility. Claude Code requires a supported Claude model and Anthropic Messages behavior; image and video models cannot replace it. Ask support to confirm the model's protocol, streaming, tool calling and long-context limits before using coding agents in production.
Minimal text example#
Replace YOUR_CHAT_MODEL_ID with a verified Chat Completions model. Generation requests consume service credit. Start with a small non-streaming request, then test streaming and a complete tool-call round trip separately.
curl --fail-with-body -sS "https://u9ai.ai/v1/chat/completions" \
-H "Authorization: Bearer $U9AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_CHAT_MODEL_ID","messages":[{"role":"user","content":"Hello"}],"stream":false}'Image, video and music APIs#
Multimodal models have separate provider contracts, fields and asynchronous task endpoints. Do not send a video model to /chat/completions or assume an OpenAI image request works for every image model. Use the model's specification and the workspace's supported fields. Keep task IDs, poll using that provider's documented query endpoint, and only treat a completed task with a valid output resource as a downloadable result.
The /api/user/playground routes are session-based website APIs, not a replacement for public API-key authentication. Do not embed a website session cookie in an external integration. If the model-specific API contract is not available, open a support ticket with the model ID and desired operation before implementing it.
Production behavior#
Preserve upstream error details and request IDs without logging credentials. Do not blindly repeat a timed-out creation request: it may already have created a billable task. Query the known task first. Stream interruption is not proof of a free failed request. Confirm the final request and wallet records.
← Documentation