Getting Started
Get up and running with the Xerotier.ai API. Learn how to authenticate, make your first request, and understand the basics of the platform.
Introduction
Xerotier.ai provides a multi-tenant inference platform that allows you to access open-source AI models through a familiar OpenAI-compatible API. Simply change your base URL and API key to start using Xerotier.ai hosted models.
Base URL
Xerotier.ai supports two URL formats for API access:
Path-based
https://api.xerotier.ai/proj_ABC123/{endpointSlug}/v1
DNS-based
You can also use subdomain-based URLs:
https://{endpointSlug}.proj_ABC123.api.xerotier.ai/v1
OpenAI SDK Compatibility
Xerotier.ai is fully compatible with the OpenAI Python and Node.js SDKs. Simply configure the base URL:
from openai import OpenAI
# Path-based URL
client = OpenAI(
base_url="https://api.xerotier.ai/proj_ABC123/my-endpoint/v1",
api_key="xero_myproject_your_api_key"
)
# Or DNS-based URL
client = OpenAI(
base_url="https://my-endpoint.proj_ABC123.api.xerotier.ai/v1",
api_key="xero_myproject_your_api_key"
)
response = client.chat.completions.create(
model="deepseek-r1-distill-llama-70b",
messages=[{"role": "user", "content": "Hello!"}]
)
import OpenAI from 'openai';
// Path-based URL
const client = new OpenAI({
baseURL: 'https://api.xerotier.ai/proj_ABC123/my-endpoint/v1',
apiKey: 'xero_myproject_your_api_key'
});
// Or DNS-based URL
const client = new OpenAI({
baseURL: 'https://my-endpoint.proj_ABC123.api.xerotier.ai/v1',
apiKey: 'xero_myproject_your_api_key'
});
const response = await client.chat.completions.create({
model: 'deepseek-r1-distill-llama-70b',
messages: [{ role: 'user', content: 'Hello!' }]
});
Quickstart
Get started with Xerotier.ai in three steps:
1. Create an Account
Sign up at xerotier.ai/auth/register to create your free account. No credit card required.
2. Create an Endpoint
From your dashboard, browse available models and click "Create Endpoint" to generate your unique completion URL.
3. Make Your First Request
curl 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
}'
curl 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
}'
Authentication
The Xerotier.ai API uses API keys for authentication. Include your API key in the Authorization header of all requests.
Authorization: Bearer xero_myproject_your_api_key
Creating API Keys
Generate API keys from your API Keys page. You can create multiple keys with different scopes and revoke them at any time.
Security Note: Keep your API keys secure. Do not share them in public repositories or client-side code. Use environment variables to store your keys. The full key value is only shown once at creation time.
API Key Format
Xerotier.ai API keys follow this format:
xero_{project_slug}_{random_characters}
Each key is scoped to a specific project identified by the slug in the key prefix.
Key Scopes
When creating an API key, you select one or more scopes that determine which APIs the key can access:
inference- Access to the Inference API (chat completions, embeddings, model listing). Enabled by default.models- Access to the Model Management API (upload, update, delete models).
A key can have both scopes enabled simultaneously. Requests to endpoints outside a key's granted scopes will receive a 403 Forbidden response.
Creating an API Key with Scopes
You can create API keys programmatically using the API. Specify the desired scopes in the request body.
curl -X POST https://xerotier.ai/proj_ABC123/v1/keys \
-H "Authorization: Bearer xero_myproject_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Model Upload Key",
"scopes": ["inference", "models"]
}'
import requests
API_KEY = "xero_myproject_your_api_key"
BASE_URL = "https://xerotier.ai/proj_ABC123/v1"
response = requests.post(
f"{BASE_URL}/keys",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
},
json={
"name": "Model Upload Key",
"scopes": ["inference", "models"]
}
)
if response.status_code == 201:
data = response.json()
# Store this key securely - it is only shown once
print(f"API Key created: {data['key']}")
else:
print(f"Error: {response.json()}")
Response
{
"id": "key_abc123def456",
"name": "Model Upload Key",
"key": "xero_myproject_abc123def456...",
"scopes": ["inference", "models"],
"createdAt": "2026-01-15T10:30:00Z"
}
Important: The full API key value is only returned once at creation time. Store it securely as it cannot be retrieved again.