Authentication

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

GET
/models
x-api-key<token>

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

POST
/predictions
x-api-key<token>

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

GET
/predictions/{id}
x-api-key<token>

Your Skytells API key. Obtain one from Dashboard → API Keys.

In: header

Path Parameters

id*string

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/completions
  • POST /responses
  • POST /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

POST
/chat/completions
x-api-key<token>

Your Skytells API key. Obtain one from Dashboard → API Keys.

In: header

Query Parameters

stream?boolean

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"
    }
  }
}
POST
/responses
x-api-key<token>

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"
    }
  }
}
POST
/embeddings
x-api-key<token>

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


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 IDMeaning
unauthorizedThe API key is invalid, expired, or missing.
invalid_requestThe 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:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix 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?

On this page