Chat (OpenAI-compatible)
POST https://gateway.mindproxy.ai/v1/chat/completionsCompatible with OpenAI Chat Completions; supports streaming, tool calling and multimodal (depending on the model).
Request
bash
curl https://gateway.mindproxy.ai/v1/chat/completions \
-H "Authorization: Bearer $TT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Introduce Hangzhou in one sentence."}
],
"temperature": 0.7,
"max_tokens": 256
}'Common fields:
| Field | Description |
|---|---|
model | Public model ID, see Models & plans |
messages | Conversation messages (role: system / user / assistant / tool) |
stream | true enables streaming (SSE) |
temperature / top_p | Sampling parameters |
max_tokens | Max output tokens |
tools / tool_choice | Tool calling, see Streaming & tools |
Other OpenAI fields are generally accepted as-is.
Response (non-streaming)
json
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hangzhou is the capital of Zhejiang, famous for West Lake."},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 24, "completion_tokens": 14, "total_tokens": 38}
}usage is the billing basis (per token). Response headers include X-TT-Request-ID etc., see Auth & Base URL.
Streaming
Add "stream": true to get SSE: data: {...} chunks (deltas), ending with data: [DONE]. SDKs wrap this — see Python / Node.js.
Other OpenAI-compatible capabilities
The same prefix also offers: /v1/embeddings, /v1/responses, /v1/images/generations, /v1/images/edits, /v1/audio/transcriptions, /v1/audio/speech. Images: Image generation.