A.S.T.R.O API · beta

One key. Every model.

Connect the provider keys you already have (Groq, Gemini, OpenAI, Anthropic, Mistral, OpenRouter and 70+ more). Then call every one of their models with a single A.S.T.R.O key, through one OpenAI-compatible endpoint.

How it works

The A.S.T.R.O API is a small, open-source gateway. It never pays for or resells model access. Instead it uses your own provider keys (this is called BYOK, "bring your own key"):

  1. You save a key for each provider you use, in your account. Each key is encrypted before it's stored.
  2. You create an A.S.T.R.O key (it starts with astro_sk_).
  3. Your apps send OpenAI-style requests to Astro. Astro picks the right provider key, forwards the request to that provider, and streams the answer back.

So the free tiers you're entitled to stay free, and paid providers bill you directly at their normal prices. Each provider's own rate limits and terms still apply.

Quick start

  1. Create an account with email, or continue with GitHub.
  2. Under Your provider keys, add at least one key. Groq, Google Gemini, Mistral, Cerebras and OpenRouter all have free tiers.
  3. Under A.S.T.R.O API keys, create a key and copy it. It's shown only once.
  4. Point any OpenAI-compatible client at the base URL below.
Base URL   https://vgtucdfretcvojcfvbzk.supabase.co/functions/v1/astro-api/v1
Auth       Authorization: Bearer astro_sk_...

Examples

curl

curl https://vgtucdfretcvojcfvbzk.supabase.co/functions/v1/astro-api/v1/chat/completions \
  -H "Authorization: Bearer $ASTRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "astro/auto",
    "messages": [{"role": "user", "content": "Explain black holes in two sentences."}]
  }'

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://vgtucdfretcvojcfvbzk.supabase.co/functions/v1/astro-api/v1",
    api_key="astro_sk_...",          # your A.S.T.R.O key
)

reply = client.chat.completions.create(
    model="groq/openai/gpt-oss-120b",   # or "astro/auto"
    messages=[{"role": "user", "content": "Write a haiku about Mars."}],
)
print(reply.choices[0].message.content)

JavaScript / TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://vgtucdfretcvojcfvbzk.supabase.co/functions/v1/astro-api/v1",
  apiKey: process.env.ASTRO_API_KEY,
});

const stream = await client.chat.completions.create({
  model: "astro/auto",
  messages: [{ role: "user", content: "Give me three names for a telescope." }],
  stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");

Plain fetch (no SDK)

const r = await fetch("https://vgtucdfretcvojcfvbzk.supabase.co/functions/v1/astro-api/v1/chat/completions", {
  method: "POST",
  headers: { "Authorization": "Bearer " + ASTRO_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ model: "astro/auto", messages: [{ role: "user", content: "Hi!" }] }),
});
console.log(r.headers.get("x-astro-provider"), (await r.json()).choices[0].message.content);
Keep your A.S.T.R.O key on a server. Anyone who has the key can use your providers. Don't put it in public web pages or mobile apps. If a key leaks, revoke it in your account. That takes effect immediately.

Endpoints

MethodPathWhat it does
GET/v1/modelsLists astro/auto plus every model your saved providers offer right now, as provider/model ids. Each entry has provider and paid fields.
POST/v1/chat/completionsOpenAI chat completions format: messages, tools, temperature, max_tokens, stream and so on. Fields are passed through to the provider unchanged.

Every successful response has two extra headers, x-astro-provider and x-astro-model, so you can see which model answered.

Choosing a model

Use provider/model, exactly as GET /v1/models lists it. For example:

  • groq/openai/gpt-oss-120b
  • gemini/gemini-2.5-flash-lite
  • openrouter/google/gemma-4-31b-it:free (everything after the first / is the provider's own model id)
  • openai/gpt-5 or anthropic/claude-sonnet-5, if you saved those paid keys

Model lists are fetched live from each provider, so new models show up without waiting for an Astro update.

astro/auto & failover

astro/auto (or just auto) tries the default model of each enabled, free-tier provider you've saved. If a provider is rate-limited (429) or down (5xx), Astro moves on to the next one, up to 4 attempts. Other errors, such as a bad request, are returned straight away so you can fix them.

Paid providers are never used by astro/auto unless you ask for it, so you can't run up a bill by accident. You can still call a paid model by naming it directly. To let astro/auto use paid providers too, add this to the request body:

{ "model": "astro/auto", "messages": [...], "astro": { "allow_paid": true } }

The astro field is removed before the request is forwarded. You can switch any provider off in your account without deleting its key.

Streaming

Set "stream": true. Astro passes the provider's server-sent events through unchanged, ending with data: [DONE], so OpenAI SDK streaming works as usual.

Limits

  • 5,000 chat requests per account per day (resets at 00:00 UTC). This protects the free service.
  • Your providers' own limits still apply. A free tier stays limited: A.S.T.R.O can't make it unlimited.
  • Requests time out after about 140 seconds.
  • Up to 10 active Astro keys per account.

Errors

Errors use the OpenAI shape: {"error": {"message", "type", "code"}}. If a provider itself returns an error, its response body is passed through, with the x-astro-provider header set.

StatusMeaning
400Bad JSON, missing messages, a malformed model id, or no provider keys saved yet.
401Missing, invalid or revoked A.S.T.R.O key (invalid_api_key).
404No saved key for that provider (model_not_found), or an unknown endpoint.
429Daily Astro limit reached (daily_limit), or every provider tried was rate-limited.
502The provider couldn't be reached or timed out.

Security

  • Provider keys are encrypted with AES-256-GCM before they're stored. Each one is bound to your account and that provider, and is decrypted only for a request you make.
  • A provider key is only ever sent to that provider's official API address, which is built into the gateway. Your account settings can't change it.
  • Astro keys are stored only as SHA-256 hashes, so nobody (including us) can read them back.
  • Prompts and answers pass through without being stored. Astro keeps only a per-day request count, for the limit and your usage chart.
  • The database tables can't be reached from the browser at all. Only the gateway can read them.
  • The gateway is open source: read the code.

FAQ

Is it free?

Yes. The A.S.T.R.O API itself costs nothing. Free-tier providers stay free within their own limits, and paid providers bill you directly.

Which providers are supported?

79 cloud providers that speak the OpenAI format, including OpenAI, Anthropic, Google Gemini, xAI, DeepSeek, Mistral, Groq, Cerebras, OpenRouter, Together, Fireworks, DeepInfra, Perplexity, Azure OpenAI and Amazon Bedrock. The full list is in your account under Add a provider. Local servers (Ollama, LM Studio and so on) can't be reached from the cloud. Use them in the desktop app instead.

Can I use it with my coding tools?

Anything that accepts a custom OpenAI base URL works. Set the base URL above and use your A.S.T.R.O key as the API key.

How do I delete my data?

Use Delete account at the bottom of your account page. Your keys, provider keys and usage history are removed immediately.