Home › AI › Developer Center

Developer Center

One place for every API this site offers.

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 your API key API Pricing

Quick Start

curl https://www.myai168.com/en/api/openai/v1/chat/completions \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Hello"}]}'

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!.

Base URLs

OpenAI-compatible     https://www.myai168.com/en/api/openai/v1
Anthropic (Claude)    https://www.myai168.com/en/api/anthropic/v1
Google                https://www.myai168.com/en/api/google/v1beta
OpenRouter-compatible https://www.myai168.com/en/api/openrouter/v1

Authentication

Create an API key on the Developer API Key page, then send it with every request:

  • Authorization: Bearer <API_KEY> — works on all endpoints (recommended).
  • x-api-key: <API_KEY> — also accepted on Anthropic (Claude) endpoints (SDK compatible).
  • x-goog-api-key: <API_KEY> — also accepted on Google endpoints (SDK compatible).
  • X-Dev-Key: <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.

Endpoints

OpenAI-compatible relay

EndpointMethodDescription
https://www.myai168.com/en/api/openai/v1/modelsGET List supported OpenAI models (generated from the pricing table).
https://www.myai168.com/en/api/openai/v1/models/{model}GET Retrieve one model (SDK client.models.retrieve compatible).
https://www.myai168.com/en/api/openai/v1/chat/completionsPOST Chat Completions relay (streaming supported; web_search_options billed per use).
https://www.myai168.com/en/api/openai/v1/responsesPOST Responses API relay (streaming supported; web_search tool billed per use).
https://www.myai168.com/en/api/openai/v1/embeddingsPOST Embeddings relay (OpenAI-compatible request/response; accepted models: voyage-4, voyage-4-large — billed per input token).
https://www.myai168.com/en/api/openai/v1/images/generationsPOST Image generation relay.
https://www.myai168.com/en/api/openai/v1/audio/speechPOST Text-to-speech relay (returns audio binary).
https://www.myai168.com/en/api/openai/v1/audio/transcriptionsPOST Speech-to-text relay (multipart upload).
https://www.myai168.com/en/api/openai/v1/audio/translationsPOST Speech translation to English (multipart upload).
https://www.myai168.com/en/api/openai/v1/audio/voicesGET List available built-in TTS voices (free).
https://www.myai168.com/en/api/openai/v1/audio/voicesPOST Custom voice creation relay.

Anthropic (Claude) relay

EndpointMethodDescription
https://www.myai168.com/en/api/anthropic/v1/modelsGET List supported Anthropic (Claude) models.
https://www.myai168.com/en/api/anthropic/v1/models/{model_id}GET Retrieve one model (SDK models.retrieve compatible).
https://www.myai168.com/en/api/anthropic/v1/messagesPOST Messages relay (streaming, prompt caching and thinking supported; web_search server tool billed per use; other server-side / hosted tools such as code execution are not supported — see the guide).
https://www.myai168.com/en/api/anthropic/v1/messages/count_tokensPOST Token counting relay (free).

Google relay

EndpointMethodDescription
https://www.myai168.com/en/api/google/v1beta/modelsGET List supported Google models (generated from the pricing table).
https://www.myai168.com/en/api/google/v1beta/models/{model}GET Retrieve one model.
https://www.myai168.com/en/api/google/v1beta/models/{model}:generateContent POSTGemini chat / vision / image generation relay.
https://www.myai168.com/en/api/google/v1beta/models/{model}:streamGenerateContent POSTGemini streaming relay (SSE).
https://www.myai168.com/en/api/google/v1beta/models/veo-*:predictLongRunning POSTVeo video generation (long-running operation).
https://www.myai168.com/en/api/google/v1beta/models/lyria-*:predict POSTLyria music generation.
https://www.myai168.com/en/api/google/v1beta/operations/{name}GET Poll a long-running operation (free).

OpenRouter relay

EndpointMethodDescription
https://www.myai168.com/en/api/openrouter/v1/modelsGET List OpenRouter models (proxied from the official OpenRouter list, cached 10 minutes).
https://www.myai168.com/en/api/openrouter/v1/chat/completionsPOST Chat Completions relay to OpenRouter (hundreds of vendor/model ids).
https://www.myai168.com/en/api/openrouter/v1/chat/responsesPOST Same Chat Completions request/response format as above (NOT the OpenAI Responses API schema); behaves the same as chat/completions.
https://www.myai168.com/en/api/openrouter/v1/audio/speechPOST Text-to-speech relay.
https://www.myai168.com/en/api/openrouter/v1/audio/transcriptionsPOST Speech-to-text relay (multipart upload).
https://www.myai168.com/en/api/openrouter/v1/video/generationsPOST Video generation relay.

Site-native APIs

EndpointMethodDescription
https://www.myai168.com/en/api/google/searchGET Google web search (structured JSON results).
https://www.myai168.com/en/api/google/newsGET Google News search (JSON results with resolved article URLs).
https://www.myai168.com/en/api/user/get_creditsGET Query your remaining credits (free).
https://www.myai168.com/en/ai/chat/chatPOST Site-native chat endpoint (SSE streaming; any chat model enabled on this site).

Not supported

The following vendor endpoints are NOT provided by this relay — requests to them return 404 (or 400 for hosted tools inside a supported endpoint). Do not guess from the SDK surface:

  • OpenAI /v1/batches (Batch API discount tier), /v1/files, /v1/fine_tuning, /v1/assistants, /v1/vector_stores.
  • OpenAI hosted tools inside Responses (code_interpreter / file_search / image_generation / computer use) — rejected with 400; only web_search is supported.
  • Anthropic (Claude) /v1/files, /v1/messages/batches, and server-side tools other than web_search (code execution is rejected with 400) — the relay uses one shared upstream workspace, so file / container APIs would risk cross-user access.

Streaming

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.

Billing and response headers

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 ignored by spec-compliant SSE parsers and official SDKs, so they never affect compatibility; read them from the raw stream if you want per-call billing. You can always query GET https://www.myai168.com/en/api/user/get_credits. Failed calls, and calls where the vendor returns no usage information, are never charged.

Error handling

HTTP statusMeaning
401Missing or invalid API key. Repeated failures from the same IP are rate-limited.
402Insufficient credits (Insufficient credits. Please top up! / You need to top up!).
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.
400Invalid request body, or an unsupported hosted / server-side tool was requested.
502Upstream vendor error — never charged.

Documentation

API Documentation

  • OpenAI ChatGPT API — Chat Completions / Responses / audio / images relay, request parameters, errors, streaming.
  • Anthropic (Claude) API — Messages relay, request parameters, errors, streaming.
  • Google Gemini API — generateContent / streamGenerateContent / Veo / Lyria relay.
  • Google Search API — Google web search (structured JSON results).
  • Google News API — Google News search (JSON results with resolved article URLs).
  • OpenRouter API — Multi-vendor LLM gateway relay (Chat Completions format).
  • API Pricing — How usage is converted to account credits.

CLI & Agent Guides

  • cc-switch macOS
  • cc-switch Windows
  • cc-switch Linux
  • OpenCode macOS
  • OpenCode Windows
  • OpenCode Linux
  • OpenClaw macOS
  • OpenClaw Windows
  • OpenClaw Linux
  • Hermes Agent macOS
  • Hermes Agent Windows
  • Hermes Agent Linux
  • Claude Code CLI macOS
  • Claude Code CLI Windows
  • Claude Code CLI Linux
  • Codex CLI macOS
  • Codex CLI Windows
  • Codex CLI Linux

MYAI168 API & MCP

  • MYAI168 MCP CLI — Connect CLI / coding agents to this site via MCP with an API key.
  • MYAI168 MCP Web & App — Connect Claude.ai and other MCP clients via OAuth.

Tools

  • Your IP and Country — Shows the IP address you are connecting from and the country it is located in.

MCP server

Chat modules this site shares over MCP are exposed as MCP (Model Context Protocol) tools. Connect an MCP client to:

https://www.myai168.com/en/mcp/

Authentication: Authorization: Bearer <API_KEY> (CLI / coding agents), or OAuth 2.1 login for clients such as Claude.ai (leave Client ID / Secret empty — the server supports Dynamic Client Registration). See the MCP guides in the documentation list above.