Burn
OpenAI-compatible metered chat completions
Accepts the OpenAI Chat Completions request shape. With stream=true, returns provider-native SSE without full-response buffering. Locus captures the fixed authorized charge before delivering the first byte.
post/wrapped/credits/v1/chat/completions
Request
- Base URLhttps://api.paywithlocus.com/api
- URLhttps://api.paywithlocus.com/api/wrapped/credits/v1/chat/completions
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Headers
X-Locus-Session-Idstring
Required only when the end-user JWT carries sid. Send the original high-entropy session value; sid is its SHA-256 fingerprint. Ignored for secret-key authentication.
Idempotency-Keystring required
One key per model request body; reuse it on an identical retry.
X-Locus-End-Userstring
Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
X-Locus-Agent-Loop-Idstring
Required when this user's policy sets maxCallsPerLoop.
Request body
Response
OpenAI JSON response, or unbuffered OpenAI SSE when stream=true
object required
Changes
No recorded changes to this operation across all 1 revision of this API.