Astrodyne

Quickstart

From zero to a successful request in under five minutes.

1. Create an account and add funds

Create an account, then add funds to your balance on the Billing page. Requests are charged from your balance per request, based on actual token usage — there is no subscription or minimum.

2. Create an API key

On the API Keys page, choose Create API Key, name it, and copy the key when it is shown.

Security
The full key is shown exactly once, at creation. Astrodyne stores only a hash. If you lose a key, revoke it and create a new one.

3. Store the key in an environment variable

shell
export ASTRODYNE_API_KEY="your_astrodyne_api_key"

Keep keys out of source control and out of browser-delivered code.

4. Send your first request

curl
curl https://api.astrodyne.ai/v1/chat/completions \
  -H "Authorization: Bearer $ASTRODYNE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "model": "YOUR_MODEL_ID",
       "messages": [{"role": "user", "content": "Hello"}]
     }'

Or with the OpenAI SDK:

Python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.astrodyne.ai/v1",
    api_key=os.environ["ASTRODYNE_API_KEY"],
)

resp = client.chat.completions.create(
    model="YOUR_MODEL_ID",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
JavaScript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.astrodyne.ai/v1",
  apiKey: process.env.ASTRODYNE_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "YOUR_MODEL_ID",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);

5. Read the response

The body is a standard Chat Completion: your answer is at choices[0].message.content, and usage carries prompt_tokens, completion_tokens, and total_tokens.

6. Find your request in the Request Explorer

Every response includes an X-Astrodyne-Request-Id header with a public ID like req-abc123. Paste it into the Request ID filter on the Requests page to see the request's status, token usage, latency, and the settled charge.

7. Try the Playground

The Playground runs requests from your browser through the same gateway as your production traffic — paste a key, pick a model, and press Run.