Overview & Authentication
YouQi AI provides a unified, OpenAI-compatible API. A single API key lets you call models from OpenAI, Anthropic, Google, DeepSeek, and more. Just point your existing OpenAI client's base URL and API key to YouQi AI — no code changes required.
Endpoint
| Item | Value |
|---|---|
| Base URL (OpenAI-compatible / Claude native) | https://ai.youqi.tech/v1 |
| Base URL (Gemini native) | https://ai.youqi.tech/v1beta |
| Content type | application/json (except binary uploads for audio / images) |
Use the Gateway only
All client traffic (LLM, GET /v1/models, Ark Seedance, assets) must use the Gateway Base from the console. Bypassing the Gateway will not list Seedance and cannot reach video/asset routes.
A few vendor-specific video formats use their own path prefix
Ark Seedance (/api/v3/..., video API key) and the asset library (/openapi/volcengine/..., AK/SK HMAC), Kling (/kling/...), and Jimeng (/jimeng/...) are not under /v1 — see each page.
Authentication
A single sk-... key works for every endpoint, but different formats pass the key differently:
| Format | Auth | Example |
|---|---|---|
| OpenAI-compatible (default) | Authorization: Bearer <KEY> | Authorization: Bearer sk-YOUR_API_KEY |
| Claude native (Messages) | x-api-key: <KEY> + anthropic-version header | x-api-key: sk-YOUR_API_KEY |
| Gemini native (/v1beta) | query param ?key=<KEY> or x-goog-api-key header | ...:generateContent?key=sk-YOUR_API_KEY |
For most use cases the OpenAI-compatible format is all you need:
Authorization: Bearer sk-YOUR_API_KEYCreate a key (formatted sk-...) on the API Keys page in the console. The full key is shown only once at creation — store it securely.
Quickstart
curl https://ai.youqi.tech/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{ "role": "user", "content": "Introduce yourself in one sentence." }
]
}'from openai import OpenAI
client = OpenAI(
base_url="https://ai.youqi.tech/v1",
api_key="sk-YOUR_API_KEY",
)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://ai.youqi.tech/v1",
apiKey: "sk-YOUR_API_KEY",
});
const resp = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);Response format
A successful response returns HTTP 200 with a JSON body. Streaming requests ("stream": true) return chunks as Server-Sent Events, ending with data: [DONE].
Error handling
Errors return a standard HTTP status code plus a JSON error body:
{
"error": {
"message": "A human-readable message",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}| Status | Meaning |
|---|---|
400 | Invalid request parameters |
401 | Missing or invalid API key |
403 | No access to the model or resource |
404 | Model or endpoint not found |
429 | Rate limited or insufficient balance |
5xx | Server / upstream error, retry later |
Billing
You are billed from your account balance based on actual usage (tokens / duration / count, depending on the endpoint), with no minimum spend. See live per-model pricing on the Models page in the console.