This site provides OpenAI-compatible, Anthropic (Claude)-compatible, Google and OpenRouter relay APIs, plus site-native utility APIs (Google Search / News, chat, credits) and an MCP server. Usage is billed to your account credits; failed calls are never charged.
Get started in three steps:
Authorization: Bearer YOUR_API_KEY header, for example:curl https://www.myai168.com/en/api/openai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Hello"}]}'
A successful call returns the standard OpenAI JSON: the reply text is in choices[0].message.content, and the response headers carry the points charged (X-Cost-Points) and your remaining balance (X-Credits-Remaining).
The same call in Python (install the package first with pip install requests):
import requests
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/chat/completions",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"model": "gpt-6.1-sol", "messages": [{"role": "user", "content": "Hello"}]},
timeout=600,
)
r.raise_for_status()
print(r.json()["choices"][0]["message"]["content"])
print("cost:", r.headers.get("X-Cost-Points"), "remaining:", r.headers.get("X-Credits-Remaining"))
List the models each relay accepts with GET https://www.myai168.com/en/api/openai/v1/models or GET https://www.myai168.com/en/api/anthropic/v1/models — the returned list is exactly what the relay accepts; other models are rejected with No pricing info! Please use other models!.
Each relay page includes official SDK examples (for example OpenAI ChatGPT API); CLI tools such as Claude Code and Codex have step-by-step guides under "CLI & Agent Guides" in the Developer Center.
| Name | Base URL | Use it for | Base URL for the official SDK | Documentation |
|---|---|---|---|---|
| OpenAI-compatible | https://www.myai168.com/en/api/openai/v1 | OpenAI SDK, Codex and other OpenAI-compatible tools; GPT models, decisions, images, speech and embeddings. | Same as the Base URL | OpenAI ChatGPT API |
| Anthropic (Claude) | https://www.myai168.com/en/api/anthropic/v1 | Anthropic SDK and Claude Code; Claude models. | https://www.myai168.com/en/api/anthropic (without /v1 — the SDK adds it) | Anthropic (Claude) API |
https://www.myai168.com/en/api/google/v1beta | Google Gen AI SDK; Gemini models, image generation and speech. | https://www.myai168.com/en/api/google (without /v1beta — the SDK adds it) | Google Gemini API | |
| OpenRouter-compatible | https://www.myai168.com/en/api/openrouter/v1 | Models from many vendors through one Chat Completions format; text-to-speech (ElevenLabs and others) and video generation. | OpenAI SDK: same as the Base URL | OpenRouter API |
REST calls (curl, requests) use the Base URL plus the endpoint path, for example https://www.myai168.com/en/api/anthropic/v1/messages. Official SDKs add the version path themselves, so the Anthropic and Google SDKs take a shorter base URL — a wrong base URL is the most common cause of 404 errors.
To use the image, speech and video generation modules enabled on this site, call the site-native chat endpoint instead — see MYAI168 Chat API Guide.
Create an API key on the Developer API Key page, then send it with every request:
Authorization: Bearer YOUR_API_KEY — works on all endpoints (recommended).x-api-key: YOUR_API_KEY — also accepted on Anthropic (Claude) endpoints (SDK compatible).x-goog-api-key: YOUR_API_KEY — also accepted on Google endpoints (SDK compatible).X-Dev-Key: YOUR_API_KEY — also accepted on the site-native Google Search / News, chat and MCP endpoints.Never place API keys in URL query strings — URLs are recorded in access logs and browser history. Endpoints do not accept keys via query parameters.
Chat Completions, Responses, Anthropic Messages and Gemini streamGenerateContent support streaming. Send "stream": true (or use the streaming endpoint) and read the response as Server-Sent Events (data: {JSON} lines). With curl, add -N (--no-buffer) to see tokens as they arrive.
Each relay keeps its vendor's own event format: OpenAI Chat Completions sends data: chunks and ends with data: [DONE]; the Responses API and Anthropic Messages send named events (response.output_text.delta and content_block_delta carry the text); Gemini sends plain data: chunks. Each relay page shows a full sample.
Prefer streaming for long outputs or high reasoning effort: the relay waits up to about 10 minutes for the model, and a non-streaming call returns nothing until the whole reply is ready.
Usage is billed to your account credits. Non-streaming relay responses include X-Cost-Points (points charged for this call) and X-Credits-Remaining (your balance after the call). Streaming responses cannot carry these headers; instead, after the final event (e.g. data: [DONE]) the stream ends with SSE comment lines carrying the same information:
: cost=12 : credits-remaining=34567
Comment lines (starting with :) are skipped by spec-compliant SSE parsers and official SDKs, so they never affect compatibility; Google Gemini streaming does not send them. Read them from the raw stream if you want per-call charges. You can always query GET https://www.myai168.com/en/api/user/get_credits. Failed calls are never charged.
| HTTP status | Meaning |
|---|---|
400 + No pricing info! Please use other models! | The requested model is not on this relay's supported list — call the /models endpoint for the accepted list. |
400 | Invalid request body, or an unsupported hosted / server-side tool was requested. |
401 | Missing or invalid API key. Repeated failures from the same IP are rate-limited. |
401 + API key credit limit reached! | This key has reached the credit limit set on the Developer API Key page; raise the limit or use another key. |
402 | Insufficient credits (Insufficient credits. Please top up! / You need to top up!). |
404 | The endpoint does not exist, or this site has not enabled the external API service (External API service is not available on this site.). |
405 | Wrong HTTP method (for example GET on an endpoint that only accepts POST). |
413 | The request body exceeds the size limit of this site. |
429 / 5xx | Rate limiting or overload reported by the upstream vendor — the status code and error body are passed through unchanged. |
500 | Temporary server error — never charged; please retry later. |
502 | Upstream vendor error — never charged. |
Error responses are JSON with the message in error.message. No error is ever charged.
How to handle them: for 400 / 404 / 405 fix the request (retrying will not help); for 401 check the key and its credit limit; for 402 top up; for 429 and 5xx wait and retry with increasing delays (for example 2, 4, then 8 seconds).
finish_reason / stop_reason / finishReason) before using it — a reply cut off at the token limit looks like a normal one./models list exactly; refresh the list from time to time, because vendors retire models.X-Cost-Points and X-Credits-Remaining response headers, or query GET https://www.myai168.com/en/api/user/get_credits at any time.| Endpoint | Method | Description | Documentation |
|---|---|---|---|
https://www.myai168.com/en/api/google/search | GET | Google web search (structured JSON results). | Google Search API |
https://www.myai168.com/en/api/google/news | GET | Google News search (JSON results with resolved article URLs). | Google News API |
https://www.myai168.com/en/api/user/get_credits | GET | Query your remaining credits (free). | — |