API basics
Base URLs, auth, streaming, errors and rate limits.
Base URL
SipToken accepts three request formats. There are two forms of the Base URL:
| Format | Base URL | Typical clients |
|---|---|---|
| OpenAI | https://api.siptoken.ai/v1 | OpenAI SDK, Codex, and clients labeled "OpenAI compatible" |
| Anthropic | https://api.siptoken.ai | Anthropic SDK, Claude Code |
| Gemini | https://api.siptoken.ai | Gemini SDK, Gemini CLI |
The only difference is the trailing /v1:
- If the client only appends
/chat/completionsor/responses, include/v1in the Base URL. - If the client appends
/v1/messagesor/v1beta/...itself, leave/v1out.
When in doubt, read the error. A request path containing /v1/v1/ means /v1 was added twice. A 404 usually means /v1 is missing or doubled.
Endpoints
| Method | Path | Format |
|---|---|---|
| POST | /v1/chat/completions | OpenAI Chat Completions |
| POST | /v1/responses | OpenAI Responses |
| POST | /v1/messages | Anthropic Messages |
| POST | /v1beta/models/{model}:generateContent | Gemini |
| POST | /v1beta/models/{model}:streamGenerateContent?alt=sse | Gemini streaming |
| GET | /v1/models | Model list |
Authentication
Every endpoint accepts this header:
Authorization: Bearer sk-xxxxxxxx
In addition:
/v1/messagesalso acceptsx-api-key: sk-xxxxxxxx. When you use it, also sendanthropic-version: 2023-06-01.- The Gemini endpoints also accept an
x-goog-api-key: sk-xxxxxxxxheader or a?key=sk-xxxxxxxxURL parameter.
The examples below read the key from the SIPTOKEN_API_KEY environment variable. See Quickstart for how to set it.
Request formats
Here is the smallest request for each format. The examples use macOS / Linux syntax. For Windows PowerShell, see Quickstart.
OpenAI Chat Completions
curl https://api.siptoken.ai/v1/chat/completions \
-H "Authorization: Bearer $SIPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"ping"}]}'
The reply is in choices[0].message.content.
OpenAI Responses
curl https://api.siptoken.ai/v1/responses \
-H "Authorization: Bearer $SIPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.2-astra","input":"ping"}'
The reply is in the output array.
Anthropic Messages
curl https://api.siptoken.ai/v1/messages \
-H "x-api-key: $SIPTOKEN_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-5-5","max_tokens":1024,"messages":[{"role":"user","content":"ping"}]}'
max_tokens is required. The reply is in content[0].text.
Gemini
curl "https://api.siptoken.ai/v1beta/models/gemini-4-neon:generateContent" \
-H "x-goog-api-key: $SIPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"ping"}]}]}'
The model ID goes in the path, not in the body. The reply is in candidates[0].content.parts[0].text.
Which format for which model
Calling a model in its own native format is the safest choice:
| Model | Recommended format |
|---|---|
claude-* | Anthropic (/v1/messages) |
gpt-* | OpenAI (/v1/chat/completions or /v1/responses) |
gemini-* | Gemini (/v1beta/...) |
deepseek-v4-pro, kimi-k3.1-pro, glm-5.3, qwen4-max | OpenAI (/v1/chat/completions) |
grok-* | OpenAI (/v1/chat/completions or /v1/responses) only |
Most other combinations work too: claude-* and gemini-* accept the OpenAI format, DeepSeek, Kimi, GLM and Qwen accept the Anthropic format, and gpt-* accepts the Anthropic and Gemini formats. The exception is grok-*, which returns an error in the Anthropic or Gemini format.
Grok bills about 200–1,250 more input tokens than you send, because the upstream adds its own system prompt to every request. Most of these are billed at the cached-input price, and they show up in your usage log.
SDK examples
Install the SDKs first:
pip install openai anthropic
Python: openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["SIPTOKEN_API_KEY"],
base_url="https://api.siptoken.ai/v1",
timeout=600,
)
resp = client.chat.completions.create(
model="gpt-6.1-sol",
messages=[{"role": "user", "content": "ping"}],
)
print(resp.choices[0].message.content)
Python: anthropic
import os
import anthropic
client = anthropic.Anthropic(
api_key=os.environ["SIPTOKEN_API_KEY"],
base_url="https://api.siptoken.ai",
timeout=600,
)
msg = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "ping"}],
)
print(msg.content[0].text)
Note that base_url differs between the two SDKs: openai includes /v1, anthropic does not.
Streaming
Add "stream": true to the request body and the response becomes an SSE stream that arrives as it's generated.
- OpenAI format: each line starts with
data:, and the last line isdata: [DONE]. - Anthropic format: the stream is a series of events such as
message_start,content_block_deltaandmessage_stop. - Gemini format: don't add
stream. Use the:streamGenerateContent?alt=ssepath instead.
When watching a stream with curl, add -N, or curl will buffer the output and print it all at once:
curl -N https://api.siptoken.ai/v1/chat/completions \
-H "Authorization: Bearer $SIPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","stream":true,"messages":[{"role":"user","content":"Count from 1 to 10"}]}'
Python openai:
stream = client.chat.completions.create(
model="gpt-6.1-sol",
messages=[{"role": "user", "content": "Count from 1 to 10"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Python anthropic:
with client.messages.stream(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Count from 1 to 10"}],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
Rate limits and timeouts
- Each account can make up to 120 requests per minute. All keys on the account count toward the same limit.
- Going over returns 429. Wait and retry, doubling the delay each time: 1 second, 2 seconds, 4 seconds and so on.
- Use streaming for long-running tasks. A non-streaming request only returns once generation is complete, so it's more likely to time out along the way.
- Set your client timeout to about 600 seconds. The SDK examples above already set
timeout=600.
Model list
curl https://api.siptoken.ai/v1/models \
-H "Authorization: Bearer $SIPTOKEN_API_KEY"
This returns the model IDs your key can use. Current model IDs:
claude-opus-5-5
claude-sonnet-5-5
claude-haiku-5-5
claude-haiku-4-5
gpt-6.2-astra
gpt-6.1-sol
gpt-6-luna
gemini-4-argon
gemini-4-neon
gemini-3.8-flash
grok-4.7
deepseek-v4-pro
kimi-k3.1-pro
glm-5.3
qwen4-max
The API response is the source of truth. For model details and prices, see Models.
Errors
| Status | Usual cause | What to do |
|---|---|---|
| 401 | Usually the key is invalid, deleted, disabled or expired. The message usually says "invalid token" | Check the key's status on the Tokens page. Copy it again without spaces or line breaks |
| 403 (mentions quota) | Usually your account balance or this key's quota is used up | Top up on the Wallet page, or raise the key's quota on the Tokens page |
| 404 | Usually a wrong path: the Base URL is missing /v1 or has it twice | Fix it using the Base URL table above |
| 429 | Usually you've hit the 120 requests per minute limit | Wait and retry, doubling the delay each time |
| 503 (mentions "no available channel") | Usually the model name has a typo, or the model isn't enabled for your group | Check model IDs with GET /v1/models and copy them exactly |
| Other 5xx, timeouts | Usually a temporary failure, or a non-streaming request that ran too long | Retry. Switch long tasks to streaming. Check the status page |
Troubleshooting
- Test the key itself with the curl commands above. If curl works but your tool doesn't, the problem is in the tool's settings. Check the Base URL, the
/v1part and the model name. - If curl fails too, look up the status code in the error table above.
- Still stuck? Check the status page.
- If none of that helps, contact support through the contact page. Support hours are 13:00 to 03:00 Beijing time. Include the request time, model, status code and the exact error message. Never send the key itself.
FAQ
Should the Base URL include /v1?
For the OpenAI format, yes. For the Anthropic and Gemini formats, no. See the Base URL table above.
Where can I see my usage?
In the usage logs in the console. You can filter by key, model and time.
Do you store request content?
No. We only record usage: request time, model, token counts, cost and which key was used. Server logs also contain the request IP. Prompts and responses are not stored.
Can I get a higher rate limit?
Every account currently gets 120 requests per minute. If you need more, tell us what it's for through the contact page.