OpenAI-Compatible API
OpenAI-compatible endpoints for Chat Completions, Embeddings, Images, Audio, Responses, and more
TokenLink provides a complete OpenAI-compatible API — you can call it directly with any OpenAI SDK or compatible tool.
Chat Completions
POST /openai/chat/completionsThe most commonly used chat completion endpoint, supporting streaming and non-streaming.
Request example
curl https://tokenlink.stelarx.ai/openai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain what an API proxy is"}
],
"temperature": 0.7,
"stream": false
}'Streaming request
curl https://tokenlink.stelarx.ai/openai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5",
"messages": [{"role": "user", "content": "Write a poem"}],
"stream": true
}'Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | ✅ | Model ID |
messages | array | ✅ | List of messages |
temperature | number | Sampling temperature (0-2) | |
top_p | number | Nucleus sampling (0-1) | |
max_tokens | integer | Maximum output tokens | |
stream | boolean | Whether to stream output | |
tools | array | Tool definitions | |
tool_choice | any | Tool selection strategy |
Response
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"model": "gpt-5",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "An API proxy is..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 30,
"completion_tokens": 150,
"total_tokens": 180
}
}Embeddings
POST /openai/embeddingscurl https://tokenlink.stelarx.ai/openai/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "text-embedding-3-small",
"input": "TokenLink is an AI API proxy platform"
}'Images
POST /openai/images/generationscurl https://tokenlink.stelarx.ai/openai/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "dall-e-3",
"prompt": "An illustration of a futuristic city",
"size": "1024x1024"
}'Audio
Text-to-speech (TTS)
POST /openai/audio/speechcurl https://tokenlink.stelarx.ai/openai/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "tts-1",
"input": "Hello, welcome to TokenLink",
"voice": "alloy"
}' --output speech.mp3Speech-to-text (Whisper)
POST /openai/audio/transcriptionsResponses API (new)
POST /openai/responsesOpenAI's recommended next-generation API, supporting reasoning, tool calling, and other advanced features.
curl https://tokenlink.stelarx.ai/openai/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5",
"input": "Analyze the performance issues in this code",
"reasoning": {"effort": "high"}
}'Rerank
POST /openai/rerankcurl https://tokenlink.stelarx.ai/openai/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5",
"query": "API proxy",
"documents": ["Document 1", "Document 2", "Document 3"],
"top_n": 2
}'List models
GET /openai/modelscurl https://tokenlink.stelarx.ai/openai/models \
-H "Authorization: Bearer YOUR_API_KEY"