Other
API contract
Current API behavior and contract.
- Requests are forwarded in the same wire format as their API or wire family. The internal call entry selects the model product and upstream; requests are not converted across protocols.
- User API keys and upstream provider keys are strictly separated.
- Public model ids are published per internal call entry; availability cannot be inferred across model lists.
- Documented paths support both forms, with and without a trailing
/. - The model list does not charge, write usage, or represent real-time upstream health.
- Before a call starts, available account balance after subtracting in-flight request reservations must be greater than zero. After settlement, the account balance may become negative.
- Error responses should return a stable error code and
request_idwhenever possible; Gemini uses a Google-style error structure. - For token products, a valid success JSON object or a stream with extractable generated output may use only a conservative lower-bound estimate when usage is missing or invalid. Raw transport chunks, upstream heartbeats, empty protocol events, and streams with no extractable output do not qualify. Images are charged by the actual number of valid images.
- Image-to-image on the website uses the signed-in web session at
/api/img/edits; public/v1/images/editsis not exposed.
For more detail, start with API overview for the API families, call entries, and fields.
Last updated on