Skip to main content

Module openrouter

Module openrouter 

Source
Expand description

OpenRouter /api/v1/key and /api/v1/credits response shapes.

Type-only - the HTTP fetcher lives in the forge-gateway OpenRouter backend. These are the JSON wire shapes; the fetcher deserializes into them.

Re-exports§

use serde::Deserialize; 🔒
use serde::Deserialize; 🔒
use serde::Serialize; 🔒
use serde::Serialize; 🔒

Structs§

CreditsData
The account’s credit pool, in USD. Both figures are required: a payload missing either is a shape forge cannot compute a balance from, and half a balance is worse than none.
CreditsResponse
Envelope for the account credit endpoint. /v1/credits is account-wide - the figures cover every key on the account - unlike KeyData’s per-key spend.
KeyData
Per-key spend. The figures are scoped to the key the request authenticated with, not to the account: the same endpoint called with a different key on the same account returns that key’s own numbers. Today, this week and this month arrive pre-computed, so forge does no summation and no timezone arithmetic.
KeyResponse
Envelope. The endpoint wraps everything in a single data object.