Helpdesk / API
Chat Completions API
Wrees exposes an OpenAI-compatible, non-streaming chat completions endpoint. Use it with a Wrees API key to relay requests through the configured AI provider while enforcing per-user token limits.
Endpoint
https://wrees.com/v1/chat/completionsPoint OpenAI-compatible clients at the Wrees base URL and use the /v1/chat/completions path.
API Keys
Sign in and open Dashboard / API to generate or revoke your key. Keys are shown only once after generation.
If a key is exposed in logs, screenshots, chat, or source code, regenerate it immediately. Revoked keys stop working for all integrations.
Authentication
Use either OpenAI-style bearer auth or the direct API key header.
Authorization: Bearer wrees_your_api_key
x-api-key: wrees_your_api_keySupported Models
The API accepts the request's model field only when it matches an allowed Wrees model and that model is enabled for your API key by an admin.
When the upstream is configured for OpenRouter, model IDs ending in :free are also accepted and use the same local request and token limits.
gpt-5.2gpt-5.4gpt-5.5gpt-5.4-minigemini-3-progemini-3-flashgemini-3-flash-thinkinggemini-3-pro-plusgemini-3-flash-plusgemini-3-flash-thinking-plusgemini-3-pro-advancedgemini-3-flash-advancedgemini-3-flash-thinking-advancedclaude-opus-4-7claude-sonnet-4-6claude-haiku-4-5-20251001Limits
Admins set each user's input tokens per request, output tokens per request, daily input cap, and daily output cap. Input tokens are counted before the upstream call. Output tokens are capped before forwarding the request when possible.
Streaming is not currently supported. Requests with stream: true return a 400 response.
cURL Example
curl https://wrees.com/v1/chat/completions -H "Authorization: Bearer wrees_your_api_key" -H "Content-Type: application/json" -d '{
"model": "gpt-5.4-mini",
"messages": [
{ "role": "user", "content": "Write a one-line product tagline." }
],
"max_completion_tokens": 80
}'JavaScript Example
const response = await fetch("https://wrees.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.WREES_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-5.4-mini",
messages: [
{ role: "system", content: "You are concise." },
{ role: "user", content: "Explain rafters in one sentence." }
],
max_completion_tokens: 120
})
})
const data = await response.json()
console.log(data.choices[0].message.content)Request Body
modelstring
Required. Must be one of the supported models.
messagesarray
Required. OpenAI-style chat messages.
streamboolean
Optional. Must be false or omitted.
max_completion_tokensnumber
Optional. Capped by your output token limits.
max_tokensnumber
Optional legacy alias. Capped by your output token limits.
Response Shape
Successful responses are relayed from the upstream AI provider in the OpenAI chat completion format.
{
"id": "resp_...",
"object": "chat.completion",
"model": "gpt-5.4-mini",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 24,
"total_tokens": 66
}
}Errors
400Invalid request, unsupported model, or streaming requested.
401Missing, revoked, or invalid API key.
413Input token limit exceeded for the user.
429Daily input or output token limit exceeded.
500The upstream AI service is not configured or unavailable.
Need Help?
If your request fails, check that your key is active, the model is supported, and your token usage is under the configured limits. For account help, contact support.
Contact support