← Home

API Documentation

Aethon is OpenAI-compatible. Switch from OpenAI in one line of code.

Quick Start

Aethon uses the OpenAI API format. If you already use OpenAI, switching takes one line:

Python (OpenAI SDK)

python
from openai import OpenAI

client = OpenAI(
    base_url="https://aethon-production.up.railway.app/v1",
    api_key="your-aethon-api-key",
)

response = client.chat.completions.create(
    model="llama3.1:8b",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Python (Aethon SDK)

python
pip install aethon

from aethon import Aethon

client = Aethon(api_key="your-aethon-api-key")

response = client.chat.completions.create(
    model="llama3.1:8b",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

curl

bash
curl https://aethon-production.up.railway.app/v1/chat/completions \
  -H "Authorization: Bearer your-aethon-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.1:8b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Node.js

javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://aethon-production.up.railway.app/v1",
  apiKey: "your-aethon-api-key",
});

const response = await client.chat.completions.create({
  model: "llama3.1:8b",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);

Authentication

All API requests require a Bearer token. Get your API key from the Settings page after signing up.

http
Authorization: Bearer your-aethon-api-key
Keep your API key secret. Do not commit it to version control or expose it in client-side code.

Chat Completions

POST /v1/chat/completions

OpenAI-compatible chat completions. Supports multi-turn conversations.

Request Body

ParameterTypeRequiredDescription
modelstringYesModel name (e.g. "llama3.1:8b")
messagesarrayYesArray of message objects with role and content
temperaturefloatNo0.0-2.0 (default: 0.7)
max_tokensintNo1-4096
streamboolNoEnable SSE streaming (default: false)

Example Response

json
{
  "id": "chatcmpl-a1b2c3d4e5f6",
  "object": "chat.completion",
  "created": 1709827200,
  "model": "llama3.1:8b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}

Completions (Legacy)

POST /v1/completions

Legacy text completions API. Use prompt instead of messages.

bash
curl https://aethon-production.up.railway.app/v1/completions \
  -H "Authorization: Bearer your-aethon-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.1:8b",
    "prompt": "The capital of France is"
  }'

Streaming

Set stream: true to receive Server-Sent Events (SSE). Tokens are delivered as they are generated.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://aethon-production.up.railway.app/v1",
    api_key="your-aethon-api-key",
)

stream = client.chat.completions.create(
    model="llama3.1:8b",
    messages=[{"role": "user", "content": "Write a haiku"}],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)

Models

GET /models/available — No auth required.

Returns all models currently available on the network with VRAM requirements and online GPU counts.

bash
curl https://aethon-production.up.railway.app/models/available

Free tier models (unlimited, no credit card): llama3.1:8b, mistral:7b, qwen2.5:7b, gemma2:2b, phi3:mini, codellama:7b, and more. See the Models page for the full list.

Pricing

GET /pricing — Full GPU rate card, tier info, and live availability.

GET /pricing/calculate?gpu_model=RTX+4090&duration_seconds=60&tier=premium — Cost calculator.

Billing is per-second. No minimums. Promo credits deducted first.

TierMonthlyDiscountRate Limit
Free$0-5 req/min
Premium$4915% off60 req/min
Reserved$19930% off300 req/min

Errors

Error responses follow the OpenAI format:

json
{
  "detail": {
    "error": {
      "message": "Model 'unknown-model' not found",
      "type": "invalid_request_error",
      "code": "model_not_found"
    }
  }
}
StatusMeaning
400Invalid request (bad model, missing fields)
401Invalid or missing API key
429Rate limit exceeded or daily limit reached
502Inference failed on the GPU
504Request timed out (job may still complete)

Rate Limits

Rate limit headers are included in every response:

http
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 4
X-RateLimit-Reset: 1709827260

Free tier also has a 50 calls/day limit on paid models (>8B). 8B and smaller models are unlimited (rate-limited only).

Integrations

Aethon is OpenAI-compatible, so it works with any tool that supports custom OpenAI endpoints.

Questions? Check platform status or contact support.