OpenRouter is an LLM gateway. One key gives access to hundreds of models (OpenAI / Anthropic / Google / Meta / Mistral, etc.) using vendor/model naming.
POST https://www.myai168.com/en/api/openrouter/v1/chat/completionsChat Completions (OpenAI format compatible).
curl https://www.myai168.com/en/api/openrouter/v1/chat/completions \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Hello"}]}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openrouter/v1/chat/completions",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "anthropic/claude-sonnet-5", "messages": [{"role": "user", "content": "Hello"}]},
)
print(r.json())
POST https://www.myai168.com/en/api/openrouter/v1/chat/responsesNote: this endpoint is NOT the OpenAI Responses API — the request and response are both in Chat Completions format (same fields as completions above). It behaves the same as completions: both endpoints pre-check your credit balance and return 402 without forwarding when credits run out. For the OpenAI Responses API schema use https://www.myai168.com/en/api/openai/v1/responses instead.
curl https://www.myai168.com/en/api/openrouter/v1/chat/responses \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-5.6-sol","messages":[{"role":"user","content":"Hello"}]}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openrouter/v1/chat/responses",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "openai/gpt-5.6-sol", "messages": [{"role": "user", "content": "Hello"}]},
)
print(r.json())
POST https://www.myai168.com/en/api/openrouter/v1/audio/speechText-to-speech (routed through OpenRouter to TTS provider). Note: OpenRouter does not offer openai/tts-1 — current TTS model ids are versioned, e.g. openai/gpt-4o-mini-tts-2025-12-15 and mistralai/voxtral-mini-tts-2603; check the official OpenRouter model list.
curl https://www.myai168.com/en/api/openrouter/v1/audio/speech \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini-tts-2025-12-15","input":"Hello","voice":"nova"}' \
--output speech.mp3
import requests
r = requests.post(
"https://www.myai168.com/en/api/openrouter/v1/audio/speech",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "openai/gpt-4o-mini-tts-2025-12-15", "input": "Hello", "voice": "nova"},
)
with open("speech.mp3", "wb") as f:
f.write(r.content)
POST https://www.myai168.com/en/api/openrouter/v1/audio/transcriptionsSpeech-to-text (multipart upload). OpenRouter's official STT models are openai/whisper-1 / openai/whisper-large-v3 etc. (openai/gpt-4o-transcribe is not listed); this relay accepts openai/whisper-1.
curl https://www.myai168.com/en/api/openrouter/v1/audio/transcriptions \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-F file=@audio.mp3 \
-F model=openai/whisper-1
import requests
with open("audio.mp3", "rb") as f:
r = requests.post(
"https://www.myai168.com/en/api/openrouter/v1/audio/transcriptions",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
files={"file": f},
data={"model": "openai/whisper-1"},
)
print(r.json())
POST https://www.myai168.com/en/api/openrouter/v1/video/generationsVideo generation (depends on supported video models). Note: vendor/some-video-model in the examples is a placeholder, not a runnable model id — the OpenRouter video endpoint is new and the available models are announced by OpenRouter; an unsupported model gets a 4xx from the upstream (never charged).
curl https://www.myai168.com/en/api/openrouter/v1/video/generations \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"vendor/some-video-model","prompt":"A cat dancing"}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openrouter/v1/video/generations",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "vendor/some-video-model", "prompt": "A cat dancing"},
)
print(r.json())
Both endpoints take a Chat Completions format JSON body (chat/responses is not the OpenAI Responses API — it behaves the same as completions). Authenticate with an Authorization: Bearer YOUR_API_KEY header (never place keys in URL query strings).
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | required | OpenRouter model id in vendor/model form (e.g. anthropic/claude-sonnet-5). |
messages | array | required | Conversation messages (OpenAI Chat Completions format). role / content are forwarded as-is per the official format (including tool and other roles, and content-part arrays); support depends on the selected model. |
stream | boolean | optional | true streams the response as SSE. |
| Other official parameters | — | optional | Forwarded to OpenRouter as-is. |
OpenAI Chat Completions compatible: text in choices[0].message.content (streaming deltas in choices[0].delta.content). Billing converts the actual cost reported by OpenRouter into points; non-streaming responses carry X-Cost-Points (points charged) and X-Credits-Remaining (balance after the call) headers, and streaming responses append the same information after the stream ends as SSE comment lines : cost=N / : credits-remaining=M. You can also query your balance any time with GET https://www.myai168.com/en/api/user/get_credits.
| HTTP status | Meaning |
|---|---|
401 | Missing or invalid API key (repeated failures from the same IP are temporarily blocked). |
402 | Insufficient credits (chat/responses / audio / video endpoints block before forwarding). |
400 | Invalid request body, or an audio-endpoint model with no pricing info ("No pricing info! Please use other models!"). |
502 | Upstream vendor error — never charged. |
No points are ever charged on errors (including when the vendor returns no usage / cost info).