OpenAI-compatible chat completions, governed and recorded
Set the OpenAI SDK baseURL/base_url to https://www.spendline.ai/v1. WITH /v1. The SDK appends /chat/completions itself.
Providers reachable on this shape: openai, google, xai, mistral, deepseek, qwen, together, fireworks, groq. The model name selects the provider (gpt-* → OpenAI, gemini-* → Google, grok-* → xAI, mistral-* → Mistral, …).
Streaming is supported. Request/response bodies are the provider's own. Spendline does not reshape them.
Request
- Base URL: https://www.spendline.ai
- URL: https://www.spendline.ai/v1/chat/completions
- Auth: API key in header x-spendline-key
Headers
The application's OWN provider key, as Bearer <key>. Forwarded upstream.
Stable name of the bot/agent/feature making the call, e.g. support-bot. One per agent. Not per request. Required when attribution enforcement is enabled.
The end customer this request is billable to. PER REQUEST. A hardcoded value makes per-customer cost attribution useless, thread it from request context. Required when attribution enforcement is enabled.
JSON object that must include a cost-centre key: one of cost_center, costCenter, department, or team. Example: {"team":"support","env":"prod"} Per call site or per request. Required when attribution enforcement is enabled.
Groups a multi-step run.
Labels a step within a workflow.
The application route that triggered the call.
Request body
Response
Provider response, passed through unchanged. The call is recorded in the ledger.
Changes
No recorded changes to this operation across all 1 revision of this API.