Migrating from OpenAI

One diff. Nothing else changes.

Last updated 2026-08-18edit on github

Same shape as the Anthropic migration: point the client at our base URL, swap the credential, change nothing else.

The diff

  client = OpenAI(
-     base_url="https://api.openai.com/v1",
-     api_key=os.environ["OPENAI_API_KEY"],
+     base_url="https://api.lowcostllm.com/v1",
+     api_key=os.environ["LOWCOSTLLM_API_KEY"],
  )

Note the /v1 suffix. The OpenAI SDK expects it in the base URL; the Anthropic SDK does not. We accept both surfaces on the same host and route by path, so one key works for both. See both providers, one key.

What stays the same

  • Streaming with stream: true, including stream_options and usage in the final chunk.
  • Tool calling, parallel tool calls, and tool_choice in all its forms.
  • Structured outputs: both json_object and json_schema with strict mode.
  • Vision inputs, logprobs, seed, and reasoning-effort controls on the models that accept them.

Supported endpoints

We proxy the endpoints that consume tokens. Account-level endpoints stay with your provider, because they describe your relationship with them, not with us.

  • /v1/chat/completions: full support.
  • /v1/responses: full support.
  • /v1/embeddings: full support.
  • /v1/models: returns the models we actually carry, not the full upstream catalogue.
  • /v1/batches: proxied, billed at list. See pricing for why.

Rolling back

Change the two lines back. That is the whole procedure, in either direction.