Endpoints
Quickstart
Make requests to both Runars API dialects
This guide assumes you already have an API key. If not, go back to Get Started → Quickstart first.
Using the Anthropic-compatible endpoint
The simplest endpoint mirrors Anthropic's own Messages API.
curl https://api.runars.ca/v1/messages \
-H "x-api-key: sk-runars-..." \
-H "content-type: application/json" \
-d '{
"model": "glm-5.2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Explain quantum computing in one sentence."
}
]
}'Response (non-streaming):
{
"id": "...",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Quantum computers exploit superposition and entanglement..."
}
],
"model": "glm-5.2",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 34,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
}
}Using the OpenAI-compatible endpoint
The OpenAI-compatible endpoint uses the /v1/chat/completions path.
curl https://api.runars.ca/v1/chat/completions \
-H "Authorization: Bearer sk-runars-..." \
-H "content-type: application/json" \
-d '{
"model": "glm-5.2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Explain quantum computing in one sentence."
}
]
}'Response:
{
"id": "...",
"object": "chat.completion",
"created": ...,
"model": "glm-5.2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computers exploit superposition and entanglement..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 34,
"total_tokens": 46
}
}Key differences
| Aspect | Anthropic | OpenAI |
|---|---|---|
| Base URL | https://api.runars.ca | https://api.runars.ca/v1 |
| Auth header | x-api-key | Authorization: Bearer |
| Response wrapper | content: [...] | choices[0].message.content |
| Stop reason field | stop_reason | finish_reason |
| Token usage | input_tokens, output_tokens | prompt_tokens, completion_tokens, total_tokens |
Both endpoints support streaming, tool calling, and all the same features—the differences are purely in wire format.
What's next
- Setting up an SDK? Go to Install SDKs.
- Need detailed endpoint specs? See the API Endpoints reference.