Skip to content

Client Integration

Use this page when a local client or SDK asks for a base URL, API key, model, endpoint, or streaming setting.

  1. 1Start ProxAIRun the local proxy using your runtime config.
  2. 2Set the base URLPoint the client at the local Proxy listener, not the upstream provider.
  3. 3Pick the endpointThe request path determines the inbound protocol.
  4. 4Use a model nameRoutes match the client-facing model before optional upstream_model rewrite.
  5. 5Send a small requestVerify routing and error format before using tools or large prompts.
Client endpointInbound protocolUse when
/v1/responses or /responsesopenai_responsesThe client supports OpenAI Responses semantics.
/v1/chat/completions or /chat/completionsopenai_chat_completionsThe client expects Chat Completions choices[].
/v1/messages or /messagesanthropic_messagesThe client sends Anthropic Messages payloads.
WhereValueEffect
Client UI or SDKAny local placeholder if requiredSatisfies the client; does not control upstream provider auth.
providers.<name>.api_keyReal upstream provider keySent upstream using the provider protocol auth header.
Environment variablesOnly if your launcher injects them into config or CLIProxAI does not require clients to send provider secrets.

For exact auth behavior, see Behavior Contracts.

The client-facing model is matched before provider model rewrite:

[[routing.routes]]
request_protocol = "openai_chat_completions"
match_kind = "exact"
model_pattern = "MiniMax-M3-preview"
provider = "minimax"
upstream_model = "MiniMax-M3"
  • model_pattern matches what the client sends.
  • provider selects the upstream configuration.
  • upstream_model is what ProxAI sends to the provider.

See Routing and Providers and Route Matching.

Use readable text for interactive debugging, and JSON when an SDK expects structured errors:

[error_responses]
format = "json"

See Error Responses.

Streaming clients should expect protocol-specific terminal signals:

ProtocolTerminal signal
OpenAI Responsesresponse.completed
OpenAI Chat Completions[DONE]
Anthropic Messagesmessage_stop

If a stream stalls after tool-call arguments begin, check [tool_calls].timeout_secs. See Streaming Behavior.