Build with Astrelay
Everything you need to send your first request and run in production.
Quickstart
- Create an API key in the console. Give it a spend limit and an expiry.
- Set the base URL of your OpenAI-compatible SDK to the value below.
- Pick a model ID from the pricing page and send a request.
- Base URL
https://aidgu.com/v1- API key
- From Console → API keys
curl https://aidgu.com/v1/chat/completions \
-H "Authorization: Bearer $ASTRELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "<model-id>", "messages": [{"role": "user", "content": "Hello"}]}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://aidgu.com/v1",
api_key=os.environ["ASTRELAY_API_KEY"],
)
reply = client.chat.completions.create(
model="<model-id>", # any model from the pricing page
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://aidgu.com/v1",
apiKey: process.env.ASTRELAY_API_KEY,
});
const reply = await client.chat.completions.create({
model: "<model-id>",
messages: [{ role: "user", content: "Hello" }],
});
console.log(reply.choices[0].message.content);Authentication
Send your key as a bearer token in the Authorization header. Anthropic-format requests may use x-api-key instead.
Never ship an API key in browser or mobile app code. Call the API from your server.
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /v1/chat/completions | Chat completions (OpenAI format), streaming supported |
POST | /v1/responses | Responses (OpenAI format) |
POST | /v1/messages | Messages (Anthropic format) |
GET | /v1/models | Models available to your key |
Errors
| Status | Meaning | What to do |
|---|---|---|
| 400 | Invalid request, or a feature that isn’t enabled for this model | Fix the request; don’t retry automatically. |
| 401 | Missing or invalid API key | Check the key and the Authorization header. |
| 403 | The key may not use this model, or the route doesn’t match | Check the key’s model allow-list. |
| 413 | Request larger than the limit | Trim history or tool definitions. |
| 429 | Rate or concurrency limit reached | Follow Retry-After if present. Otherwise, wait at least 5 seconds and increase the delay if the limit persists. |
| 502 | Upstream could not be reached | The request may already be billed. Check usage logs before retrying. |
| 503 | Upstream paused, budget reached, or prices under review | Retry later; nothing was forwarded. |
Limits
- Request size
- 256 KiB per request, history and tool definitions included
- Output
- Up to 32,768 tokens per request
- Rate
- 60 requests per minute per account by default; ask us to raise it
- Retries
- We never retry a billed request for you
Data & privacy
We store account details, balances, API keys and request metadata (time, model, token counts, status code, request ID) to bill and support you. Prompt and response content is not written to our logs by default. Your requests are processed by the upstream provider that serves the model you choose.
Support
Email [email protected] with the request ID from your usage log. We aim to reply within one business day.