POST https://www.myai168.com/en/api/openai/v1/responsesResponses API (new chat interface with streaming support).
curl https://www.myai168.com/en/api/openai/v1/responses \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","input":"Hello"}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/responses",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "gpt-5.6-sol", "input": "Hello"},
)
print(r.json())
POST https://www.myai168.com/en/api/openai/v1/chat/completionsChat Completions API (legacy chat interface, OpenAI SDK compatible).
curl https://www.myai168.com/en/api/openai/v1/chat/completions \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Hello"}]}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/chat/completions",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "gpt-5.6-sol", "messages": [{"role": "user", "content": "Hello"}]},
)
print(r.json())
POST https://www.myai168.com/en/api/openai/v1/audio/speechText-to-speech (TTS). Returns audio binary.
curl https://www.myai168.com/en/api/openai/v1/audio/speech \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"Hello","voice":"nova"}' \
--output speech.mp3
import requests
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/audio/speech",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "tts-1", "input": "Hello", "voice": "nova"},
)
with open("speech.mp3", "wb") as f:
f.write(r.content)
POST https://www.myai168.com/en/api/openai/v1/audio/transcriptionsSpeech-to-text (STT, multipart upload).
curl https://www.myai168.com/en/api/openai/v1/audio/transcriptions \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-F file=@audio.mp3 \
-F model=gpt-4o-transcribe
import requests
with open("audio.mp3", "rb") as f:
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/audio/transcriptions",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
files={"file": f},
data={"model": "gpt-4o-transcribe"},
)
print(r.json())
POST https://www.myai168.com/en/api/openai/v1/audio/translationsTranslate speech to English text (STT + translate). The official OpenAI translations endpoint only supports whisper-1 (gpt-4o-transcribe is for transcriptions only); the examples pass response_format=verbose_json to get the full JSON including audio duration.
curl https://www.myai168.com/en/api/openai/v1/audio/translations \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-F file=@audio.mp3 \
-F model=whisper-1 \
-F response_format=verbose_json
import requests
with open("audio.mp3", "rb") as f:
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/audio/translations",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
files={"file": f},
data={"model": "whisper-1", "response_format": "verbose_json"},
)
print(r.json())
POST https://www.myai168.com/en/api/openai/v1/images/generationsText-to-image (gpt-image-2).
curl https://www.myai168.com/en/api/openai/v1/images/generations \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2","prompt":"A cute cat","size":"1024x1024"}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/images/generations",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "gpt-image-2", "prompt": "A cute cat", "size": "1024x1024"},
)
print(r.json())
POST https://www.myai168.com/en/api/openai/v1/embeddingsText embeddings (OpenAI-compatible format; accepted models voyage-4 / voyage-4-large, billed per input token).
curl https://www.myai168.com/en/api/openai/v1/embeddings \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"voyage-4-large","input":"Hello"}'
import requests
r = requests.post(
"https://www.myai168.com/en/api/openai/v1/embeddings",
headers={"Authorization": "Bearer YOUR_DEV_KEY"},
json={"model": "voyage-4-large", "input": "Hello"},
)
print(r.json())
GET https://www.myai168.com/en/api/openai/v1/audio/voicesList available built-in TTS voices (query endpoint, free). Note: this GET listing is a site extension — the official OpenAI API reference only documents POST (create custom voice) and has no GET list endpoint, so do not expect it in the official SDK surface.
curl https://www.myai168.com/en/api/openai/v1/audio/voices \
-H "Authorization: Bearer YOUR_DEV_KEY"
POST https://www.myai168.com/en/api/openai/v1/audio/voicesCustom voice creation (voice cloning, multipart upload; fields: audio_sample voice sample file required, consent consent recording ID required (e.g. cons_1234 — per the official OpenAI spec this is obtained by uploading a consent recording first, not a free-text consent statement), name voice name). OpenAI currently limits custom voices to eligible accounts.
curl https://www.myai168.com/en/api/openai/v1/audio/voices \
-H "Authorization: Bearer YOUR_DEV_KEY" \
-F audio_sample=@sample.mp3 \
-F consent="cons_1234" \
-F name="My Voice"
GET https://www.myai168.com/en/api/openai/v1/models / GET https://www.myai168.com/en/api/openai/v1/models/{model}List supported models / retrieve one model (compatible with SDK models.list / models.retrieve; query endpoints, free).
curl https://www.myai168.com/en/api/openai/v1/models \
-H "Authorization: Bearer YOUR_DEV_KEY"
curl https://www.myai168.com/en/api/openai/v1/models/gpt-5.6-sol \
-H "Authorization: Bearer YOUR_DEV_KEY"
Some OpenAI SDK features behave differently through this relay. Check this matrix before integrating to avoid surprises.
GET /v1/models and GET /v1/models/{model} —
supported (compatible with SDK models.list /
models.retrieve). Returns exactly the models
this relay accepts; models not in the list are rejected with
"No pricing info! Please use other models!".POST /v1/responses and
POST /v1/chat/completions — supported, including streaming.tools: [{"type": "web_search"}], Chat Completions
web_search_options.code_interpreter,
file_search, image_generation, computer use,
hosted MCP) — not supported, HTTP 400. Use client-side function calling
instead.speech / transcriptions /
translations / voices — GET lists built-in
voices for free, POST creates a custom voice),
images/generations and embeddings (accepted
models voyage-4 / voyage-4-large) —
supported.X-Cost-Points (points
charged) and X-Credits-Remaining (balance after the call)
headers. Streaming responses append the same information after the final
event (data: [DONE]) 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.The request body is JSON, identical to the official OpenAI spec. Authenticate with an Authorization: Bearer YOUR_API_KEY header (never place keys in URL query strings).
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | required | Model id (e.g. gpt-5.6-sol). Must be in the GET /v1/models list, otherwise 400 with "No pricing info! Please use other models!". |
messages | array | required | Conversation messages. role supports all official roles: developer / system / user / assistant / tool (the legacy function role is deprecated but still accepted); content can be a string or an array of content parts (text / image / audio, per the official format). |
stream | boolean | optional | true streams the response as SSE (data: {JSON} chunks, ending with data: [DONE]). |
web_search_options | object | optional | Enables web search (billed per use). |
max_tokens / temperature / top_p / tools (function calling) etc. | — | optional | Other official parameters are forwarded as-is; hosted tools (code_interpreter etc.) are not supported and return 400. |
The Responses API (POST /v1/responses) uses input (string or array, required) and model (required) instead, and accepts tools: [{"type": "web_search"}]; other official parameters are forwarded as-is.
Non-streaming: official JSON — Chat Completions text is in choices[0].message.content with usage in usage; Responses text must be parsed from the output[] array (in items whose type is message, take the text field of content[] blocks whose type is output_text) — output_text is a convenience property of the official Python / JavaScript SDKs, not a field of the raw REST JSON. Response headers include X-Cost-Points (points charged) and X-Credits-Remaining (balance after the call).
Streaming: SSE chunks with Chat Completions deltas in choices[0].delta.content, ending with data: [DONE]; after the final event the stream appends SSE comment lines : cost=N / : credits-remaining=M with the points charged and remaining balance (spec-compliant SSE parsers and official SDKs ignore comment lines). You can also query GET https://www.myai168.com/en/api/user/get_credits any time.
curl -N https://www.myai168.com/en/api/openai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","stream":true,"messages":[{"role":"user","content":"Hello"}]}'
data: {"id":"...","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hi"},"index":0}]}
data: {"id":"...","object":"chat.completion.chunk","choices":[{"delta":{},"finish_reason":"stop","index":0}]}
data: [DONE]
| HTTP status | Meaning |
|---|---|
401 | Missing or invalid API key (repeated failures from the same IP are temporarily blocked). |
402 | Insufficient credits (please top up). |
400 | Invalid request body, model not in the supported list ("No pricing info! Please use other models!"), or an unsupported hosted tool was requested. |
502 | Upstream vendor error — never charged. |
No points are ever charged on errors (including when the vendor returns no usage info).