proxy

Anthropic messages, governed and recorded

Set the Anthropic SDK baseURL to https://www.spendline.ai. WITHOUT /v1. The Anthropic SDK appends /v1/messages itself. This asymmetry with the OpenAI SDK is real; do not "fix" it.

Streaming is supported.

post/v1/messages

Request

  • Base URL: https://www.spendline.ai
  • URL: https://www.spendline.ai/v1/messages
  • Auth: API key in header x-spendline-key

Headers

x-api-keystring required

The application's OWN Anthropic key. Forwarded upstream. The SPENDLINE key must NOT go here, put it in x-spendline-key.

anthropic-versionstring required
Example:2023-06-01
x-agent-idstring

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.

x-customer-idstring

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.

x-spendline-tagsstring

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.

x-workflow-idstring

Groups a multi-step run.

x-step-namestring

Labels a step within a workflow.

x-source-routestring

The application route that triggered the call.

Request body

modelstring required
max_tokensinteger required
messagesobject[] required
streamboolean

Example request

{
  "model": "claude-sonnet-5"
}

Response

Anthropic response, passed through unchanged. The call is recorded.

Changes

No recorded changes to this operation across all 1 revision of this API.