API
OpenAI-compatible format
POST https://tokenarmy.shop/v1/chat/completions is OpenAI Chat Completions-compatible, so you can call Claude using OpenAI request format; the request body is forwarded unchanged, and the response is returned in OpenAI format.
This is protocol compatibility only, not access to GPT or other vendor models. Use Claude model IDs in the
model field. Requests for other models (e.g., gpt-image-2) return 400 model_not_supported, are not forwarded, and incur no charge.Non-streaming
# pip install openai import os from openai import OpenAI client = OpenAI( base_url="https://tokenarmy.shop/v1", api_key=os.environ["TOKENARMY_API_KEY"], # sk-ta-xxxx ) response = client.chat.completions.create( model="claude-sonnet-5-5", messages=[{"role": "user", "content": "Hello"}], ) print(response.choices[0].message.content)
Streaming
Set "stream": true to get Server-Sent Events, one chunk at a time, ending with data: [DONE].
curl https://tokenarmy.shop/v1/chat/completions -H "Authorization: Bearer $TOKENARMY_API_KEY" -H "Content-Type: application/json" -d '{"model":"claude-sonnet-5-5","stream":true,"messages":[{"role":"user","content":"Hi"}]}'
For long outputs,
"stream": true is recommended: data arrives as it is generated. Non-streaming requests are not cut off for taking long: this site is accelerated by Cloudflare, which waits at most 125 seconds for a response to start, so a non-streaming request still generating after 30 seconds gets status 200 and its headers first, then a space every 15 seconds to keep the connection alive, then the complete JSON (whitespace before JSON does not affect parsing). If it fails after that point, the status is still 200 and the body is a JSON error. What was generated is billed as usual, exactly as for streaming.