Documentation
Everything you need to integrate ArcaneAPI into your application.
Quickstart
1
Get your API key
Create an account and generate an API key from your dashboard.
2
Make your first request
cURL
curl -X POST https://api.arcaneapi.com/v1/chat/completions \
-H "Authorization: Bearer ak_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.2",
"messages": [
{"role": "user", "content": "Hello, world!"}
]
}'
3
Parse the response
JSON Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "gpt-5.2",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}
Authentication
All requests require a Bearer token. Keys start with ak_.
Authorization: Bearer ak_your_api_key
Never share your API keys or commit them to version control.
Endpoints
POST
/v1/chat/completions
Create a chat completion. OpenAI-compatible format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID (e.g., "gpt-5.2") |
| messages | array | Yes | Array of {role, content} objects |
| temperature | number | No | Sampling temperature (0-2). Default: 1 |
| max_tokens | integer | No | Max tokens to generate |
| stream | boolean | No | Enable streaming. Default: false |
GET
/v1/models
List available models and pricing.
GET
/v1/status
Health check. Returns system status.
Error codes
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient balance |
| 404 | Not Found | Invalid model or endpoint |
| 429 | Rate Limited | Too many requests |
| 500 | Server Error | Retry with backoff |
Code examples
Python
import requests
response = requests.post(
"https://api.arcaneapi.com/v1/chat/completions",
headers={
"Authorization": "Bearer ak_your_api_key",
"Content-Type": "application/json"
},
json={
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": "Explain quantum computing."}
],
"max_tokens": 500
}
)
print(response.json()["choices"][0]["message"]["content"])
JavaScript
const response = await fetch(
"https://api.arcaneapi.com/v1/chat/completions",
{
method: "POST",
headers: {
"Authorization": "Bearer ak_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-5.2",
messages: [{ role: "user", content: "Hello!" }]
})
}
);
const data = await response.json();
console.log(data.choices[0].message.content);