Send your first request
One endpoint, one key, one model id.
The 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"}]
}'
In Python
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)
In JavaScript / TypeScript
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);
Replace the model id
YOUR_MODEL_ID is a placeholder. No model is currently
published for public examples — open Models and use
an id from your own account.
What comes back
A standard Chat Completion object: id, object,
created, model, choices and
usage. Every response also carries an
X-Astrodyne-Request-Id header whose value starts with
req- — keep it, it is how you look the request up later.
Then check what it cost
Open Requests, paste the request id, and you will see the model, the token counts, the latency and the exact charge.