Making API Requests
How to authenticate requests to the Skytells API using your API key.
Authentication
All requests to the Skytells API must be authenticated. The only supported method is API Key authentication — pass your key in the x-api-key header with every request.
If you don't have an API key yet, see Generating an API Key.
Making Authenticated Requests
Include the x-api-key header in every API call. The interactive examples below show the exact request format for each endpoint.
List Models
Authorization
apiKey Your Skytells API key. Obtain one from Dashboard → API Keys.
In: header
Response Body
application/json
application/json
curl -X GET "https://api.skytells.ai/v1/models"[
{
"name": "TrueFusion",
"description": "TrueFusion Standard",
"namespace": "truefusion",
"type": "image",
"status": "operational",
"capabilities": [
"text-to-image",
"image-to-image"
],
"pricing": {
"amount": 0.03,
"currency": "USD",
"unit": "image"
},
"vendor": {
"name": "Skytells",
"verified": true,
"slug": "skytells"
},
"input_schema": {},
"output_schema": {}
}
]{
"error": {
"http_status": 401,
"message": "Invalid or missing API key",
"details": "Please obtain a valid API key from the dashboard",
"error_id": "UNAUTHORIZED"
}
}Create a Prediction
Authorization
apiKey Your Skytells API key. Obtain one from Dashboard → API Keys.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://api.skytells.ai/v1/predictions" \ -H "Content-Type: application/json" \ -d '{ "model": "truefusion", "input": { "prompt": "A photo of a cat in a spaceship" } }'{
"id": "pred_abc123",
"status": "succeeded",
"model": "truefusion",
"input": {},
"output": "https://cdn.skytells.ai/outputs/pred_abc123.png",
"created_at": "2026-03-07T12:00:00Z",
"started_at": "2026-03-07T12:00:01Z",
"completed_at": "2026-03-07T12:00:05Z",
"metrics": {
"predict_time": 4.2
},
"error": "string"
}{
"error": {
"http_status": 401,
"message": "Invalid or missing API key",
"details": "Please obtain a valid API key from the dashboard",
"error_id": "UNAUTHORIZED"
}
}{
"error": {
"http_status": 401,
"message": "Invalid or missing API key",
"details": "Please obtain a valid API key from the dashboard",
"error_id": "UNAUTHORIZED"
}
}Get a Prediction
Authorization
apiKey Your Skytells API key. Obtain one from Dashboard → API Keys.
In: header
Path Parameters
The prediction ID.
Response Body
application/json
application/json
application/json
curl -X GET "https://api.skytells.ai/v1/predictions/pred_abc123"{
"id": "pred_abc123",
"status": "succeeded",
"model": "truefusion",
"input": {},
"output": "https://cdn.skytells.ai/outputs/pred_abc123.png",
"created_at": "2026-03-07T12:00:00Z",
"started_at": "2026-03-07T12:00:01Z",
"completed_at": "2026-03-07T12:00:05Z",
"metrics": {
"predict_time": 4.2
},
"error": "string"
}{
"error": {
"http_status": 401,
"message": "Invalid or missing API key",
"details": "Please obtain a valid API key from the dashboard",
"error_id": "UNAUTHORIZED"
}
}{
"error": {
"http_status": 401,
"message": "Invalid or missing API key",
"details": "Please obtain a valid API key from the dashboard",
"error_id": "UNAUTHORIZED"
}
}Inference API & Schemas
For text and embedding workloads, use the Inference API. It is OpenAI-compatible and uses the same API key authentication (x-api-key) described above.
Core inference endpoints:
POST /chat/completionsPOST /responsesPOST /embeddings
Example: Chat Completions Request
curl https://api.skytells.ai/v1/chat/completions \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepbrain-router",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize our privacy policy in 3 bullet points."}
]
}'Interactive Inference Endpoints
Authorization
apiKey Your Skytells API key. Obtain one from Dashboard → API Keys.
In: header
Query Parameters
Force streaming via query param. Equivalent to stream: true in the body.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.skytells.ai/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "deepbrain-router", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ] }'{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1748000000,
"model": "deepbrain-router",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 38,
"total_tokens": 62
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}Authorization
apiKey Your Skytells API key. Obtain one from Dashboard → API Keys.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.skytells.ai/v1/responses" \ -H "Content-Type: application/json" \ -d '{ "model": "deepbrain-router", "input": "What is machine learning?" }'{
"id": "resp_abc123",
"object": "response",
"created_at": 1748000000,
"model": "deepbrain-router",
"status": "completed",
"output_text": "Machine learning is a subset of AI...",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Machine learning is a subset of AI..."
}
]
}
],
"usage": {
"input_tokens": 12,
"output_tokens": 41,
"total_tokens": 53
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}Authorization
apiKey Your Skytells API key. Obtain one from Dashboard → API Keys.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.skytells.ai/v1/embeddings" \ -H "Content-Type: application/json" \ -d '{ "model": "deepbrain-router", "input": "The quick brown fox jumps over the lazy dog." }'{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292,
0.015797101
]
}
],
"model": "deepbrain-router",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}{
"error": {
"message": "The model 'unknown-model' was not found.",
"type": "server_error",
"code": "model_not_found",
"error_id": "MODEL_NOT_FOUND",
"status": 404,
"param": "model",
"request_id": "req_abc123xyz",
"details": {
"category": "request"
}
}
}Schema References
- Inference API overview
- Chat Completions schema
- Responses schema
- Embeddings schema
- API v1 schema guide
Using an SDK
If you use one of the official SDKs, authentication is handled automatically — just pass your API key when creating the client:
import { createClient } from 'skytells';
const client = createClient(process.env.SKYTELLS_API_KEY);The SDK attaches the correct headers to every request for you.
Authentication Errors
When a request fails authentication, the API returns a 401 error:
{
"error": {
"http_status": 401,
"message": "Invalid or missing API key",
"details": "Please obtain a valid API key from the dashboard",
"error_id": "UNAUTHORIZED"
}
}Common error types:
| Error ID | Meaning |
|---|---|
unauthorized | The API key is invalid, expired, or missing. |
invalid_request | The request is malformed or missing required fields. |
Rate Limiting
API requests are subject to rate limiting. The current limits are returned in the response headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit resets |
If you exceed the limit, you'll receive a 429 Too Many Requests response. Back off and retry after the reset time.
For full API authentication details, see the Skytells Authentication Docs.
How is this guide?