Asphodel

Docs

An OpenAI-compatible endpoint that bills by the second. Create a key, point any SDK at it, and read the meter from the response headers. Every new key starts with 600 free credits — ten minutes of generation, no card.

01Get a key

# creates an account and returns one key, once
curl -s https://asphodel-sooty.vercel.app/api/keys \
  -H 'content-type: application/json' \
  -d '{"email":"you@example.com"}'
{"account":{"id":"acct_…","email":"you@example.com"},
 "key":"asp_…","key_prefix":"asp_…",
 "balance_credits":600,"granted_credits":600}
The key is shown once and stored only as a hash. Keep it; if you lose it, ask for another. You can also create one at /account, which keeps it in your browser.

02Call it

curl

curl https://asphodel-sooty.vercel.app/v1/chat/completions \
  -H "authorization: Bearer $ASPHODEL_KEY" \
  -H 'content-type: application/json' \
  -d '{"model":"gemini-flash-lite-latest",
       "messages":[{"role":"user","content":"hello"}],
       "stream":true}'

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://asphodel-sooty.vercel.app/v1",
    api_key="asp_your_key",
)
stream = client.chat.completions.create(
    model="gemini-flash-lite-latest",
    messages=[{"role": "user", "content": "hello"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Node

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://asphodel-sooty.vercel.app/v1",
  apiKey: process.env.ASPHODEL_KEY,
});

const r = await client.chat.completions.create({
  model: "gemini-flash-lite-latest",
  messages: [{ role: "user", content: "hello" }],
});
console.log(r.choices[0].message.content);
model is optional. Omit it and the gateway picks the first provider that answers. List the ones you can name at /v1/models or browse them at /models.

03Read the meter

Every non-streaming response carries the charge:

headermeaning
x-asphodel-billedMicro-credits charged for this call. 1,000,000 = one credit = one second.
x-asphodel-elapsed-msWall-clock milliseconds from request accepted to response finished.
x-asphodel-remainingYour balance after the charge, in micro-credits.
x-asphodel-sessionThe id of this call in the ledger.

Streaming responses start at zero (nothing is known yet) and close with a comment line, which SSE clients ignore but a human can read:

data: [DONE]

: asphodel session=w465b5814 elapsed=0.45s billed=0.44 remaining=598.98 credits

04Know when it stops

statustypewhat happened
401authentication_errorNo key, or a key that was revoked.
402insufficient_creditsBalance is zero. The request never reached a model.
429rate_limitedToo many requests from one address, or a demo session started too recently.
502upstream_errorEvery provider in the chain failed or is cooling down. Retry shortly.

A stream can also end early with {"error":{"type":"escrow_exhausted"}} — the credit ran out mid-answer, so the clock stopped the stream instead of letting it run past what was paid for.

05What it costs

One credit is one second at the base rate: 1,000,000 micro-credits per second. A call that takes 450 ms is billed 0.45 credits. There is no per-token arithmetic to check and no minimum charge — a fast answer is cheap because it was fast, not because a table said so.

During launch, credit is free and every key comes with 600 credits. When they run out, ask for more at jeremy@grindnewday.com.

06Limits