API Reference
Core API endpoints for chat completions and model information. The Xerotier.ai API is fully compatible with the OpenAI API specification.
Chat Completions
Creates a model response for the given chat conversation. This is the primary endpoint for interacting with language models.
Create Chat Completion
POST /v1/chat/completions
Request Body
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | ID of the model to use (e.g., "deepseek-r1-distill-llama-70b") |
| messagesrequired | array | A list of messages comprising the conversation so far |
| max_tokensoptional | integer | Maximum number of tokens to generate. Default varies by model. |
| temperatureoptional | number | Sampling temperature (0-2). Higher values make output more random. Default: 1 |
| top_poptional | number | Nucleus sampling parameter. Default: 1 |
| streamoptional | boolean | If true, partial message deltas will be sent as SSE events. Default: false |
| stopoptional | string | array | Up to 4 sequences where the API will stop generating |
Message Object
| Parameter | Type | Description |
|---|---|---|
| rolerequired | string | The role of the message author: "system", "user", or "assistant" |
| contentrequired | string | The content of the message |
Example Request
curl (Path-based)
curl -X POST https://api.xerotier.ai/proj_ABC123/my-endpoint/v1/chat/completions \
-H "Authorization: Bearer xero_myproject_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-r1-distill-llama-70b",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"max_tokens": 100,
"temperature": 0.7
}'
curl (DNS-based)
curl -X POST https://my-endpoint.proj_ABC123.api.xerotier.ai/v1/chat/completions \
-H "Authorization: Bearer xero_myproject_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-r1-distill-llama-70b",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"max_tokens": 100,
"temperature": 0.7
}'
Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1706123456,
"model": "deepseek-r1-distill-llama-70b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 8,
"total_tokens": 33
}
}
Models
List and describe the models available through your Xerotier.ai endpoint.
List Models
GET /proj_ABC123/v1/models
Lists the currently available models and their metadata.
curl
curl https://api.xerotier.ai/proj_ABC123/v1/models \
-H "Authorization: Bearer xero_myproject_your_api_key"
Response
{
"object": "list",
"data": [
{
"id": "deepseek-r1-distill-llama-70b",
"object": "model",
"created": 1706000000,
"owned_by": "Xerotier.ai"
},
{
"id": "llama-3.1-8b-instruct",
"object": "model",
"created": 1706000000,
"owned_by": "Xerotier.ai"
}
]
}
Retrieve Model
GET /proj_ABC123/v1/models/{model}
Retrieves a model instance, providing information about the model.