cURL (general)
Use cURL to smoke-test each endpoint — handy for quick verification and debugging. First put the key in an environment variable:
bash
export TT_API_KEY="sk-your-key"Examples use the gateway address https://gateway.mindproxy.ai.
Chat (OpenAI-compatible)
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": "user", "content": "Hello"}]
}'Add "stream": true for streaming:
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", "stream": true,
"messages": [{"role": "user", "content": "Tell me a joke"}]}'Claude native (Anthropic Messages)
bash
curl https://gateway.mindproxy.ai/v1/messages \
-H "x-api-key: $TT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-5-sonnet",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'Also accepts Authorization: Bearer $TT_API_KEY.
Gemini native (generateContent)
bash
curl "https://gateway.mindproxy.ai/v1beta/models/gemini-1.5-pro:generateContent?key=$TT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents": [{"parts": [{"text": "Hello"}]}]}'Use :streamGenerateContent for streaming.
Embeddings
bash
curl https://gateway.mindproxy.ai/v1/embeddings \
-H "Authorization: Bearer $TT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "text-embedding-3-small", "input": "some text"}'Image generation
bash
curl https://gateway.mindproxy.ai/v1/images/generations \
-H "Authorization: Bearer $TT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-1", "prompt": "a city at night", "n": 1, "size": "1024x1024"}'Billed by the actual number of images returned. See Image generation.
List available models
bash
curl https://gateway.mindproxy.ai/v1/models \
-H "Authorization: Bearer $TT_API_KEY"Handy debugging tips
- See response headers: add
-i(or-D -) to print headers, includingX-TT-Request-IDfor troubleshooting. - Dry run (no model call, no charge): add
-H "X-TT-Dry-Run: true"to exercise auth and billing hold only and return a billing estimate. - Idempotency: when retrying the same request, add
-H "Idempotency-Key: <your-unique-key>"to avoid double charges.
Next: Python · Node.js · Streaming & tools