Chat-completions HTTP API — Introduction
The TokenSaver pipeline is exposed under a dedicated prefix on the public API host. Use your TokenSaver API key (ts_…) only—never the LLM vendor key alone for authentication on this surface.
Production base URL
Configure clients with no trailing slash:
https://api.tokensaver.fr/openai/v1
The SDK and console use the native prefix https://api.tokensaver.fr/api/v1 (e.g. POST /pipelines/run). The OpenAI-shaped routes live under /openai/v1 on the same host, in addition—not instead—of /api/v1.
Endpoints
Each route uses the same base URL prefix (no trailing slash).
stream (SSE)provider/model_id idsOpenAPI
Machine-readable contract (filter paths starting with /openai/v1):
GET https://api.tokensaver.fr/api/v1/openapi.json
Low-code (n8n, Make, Zapier, …)
Use the same OpenAI base URL (…/openai/v1, no trailing slash) and put your TokenSaver API key in the credential field that would normally hold an OpenAI key. Add custom HTTP headers where the tool allows it for pipeline tuning (X-Tokensaver-Options, X-Tokensaver-Use-*, X-Tokensaver-Apply-Key-Pipeline-Defaults). Agent flows that send tools require a catalogue provider in OPENAI_SHAPED_TOOL_BINDING_PROVIDERS (see Headers page). Repo guide: docs/INTEGRATION-N8N-ET-LOW-CODE.md.
Pipeline modules are opt-in
On /chat/completions and /responses, the four module flags stay off unless you either (a) send explicit module control — tokensaver keys that count (see Headers), X-Tokensaver-Options / X-Tokensaver-Extensions with those keys, or parseable boolean X-Tokensaver-Use-* headers — or (b) send no explicit module control and opt in to the key's saved console defaults with X-Tokensaver-Apply-Key-Pipeline-Defaults: true or reserved JSON apply_key_pipeline_defaults: true in tokensaver / Options / Extensions, which merges api_keys.pipeline_settings the same way as POST /api/v1/pipelines/run when the key has settings. Otherwise all four flags are forced off, even if the workspace has defaults elsewhere — this keeps generic OpenAI clients safe.
Next: All request & response headers, Chat completions, or Native pipeline for the same fields in POST /api/v1/pipelines/run.
