$0 · 100% browser-side

cURL to SDK converter

Paste any OpenAI, Anthropic, or Gemini cURL command and convert it locally into Python or TypeScript SDK code wired to https://api.keelrouter.com/v1.

Create API Key →

cURL command

Detected: openai

Target: POST https://api.keelrouter.com/v1/chat/completions

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.keelrouter.com/v1",
    api_key=os.environ["KEELROUTER_API_KEY"],
)

response = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[
        {
            "role": "system",
            "content": "Be concise.",
        },
        {
            "role": "user",
            "content": "Explain idempotency keys in 3 bullets.",
        },
    ],
)
print(response.choices[0].message.content)

Parsed 100% locally in your browser. Literal API keys in cURL headers are stripped and replaced with environment variable lookups.

Need an API key for this snippet?

Create a KeelRouter sk_ key in the console, drop it into KEELROUTER_API_KEY, and run this snippet immediately across 100+ models.

Frequently asked questions

Why does the converted code use base_url="https://api.keelrouter.com/v1"?
KeelRouter exposes OpenAI-compatible (/v1/chat/completions, /v1/responses, /v1/images/generations) and Anthropic-compatible (/v1/messages) endpoints, so changing base_url and api_key lets one key call every provider.
Are API keys inside my pasted cURL saved anywhere?
No. Parsing happens 100% locally in your browser, and hardcoded Authorization / x-api-key headers are stripped and replaced with environment variable placeholders.
Does it support Gemini cURL conversion to the OpenAI SDK?
Yes. When KeelRouter routing is enabled, Google generateContent payloads (contents[].parts[].text) are normalized into OpenAI-compatible chat completions calls.
Can I also export raw TypeScript fetch without an SDK?
Yes. Switch between the Python SDK, TypeScript SDK, and TypeScript fetch tabs above the generated output.