Switch from OpenRouter

Converter

Your code, pointed at Antimatter

Paste a snippet that calls OpenAI or OpenRouter: Python, TypeScript, curl, LangChain or the Vercel AI SDK. It is rewritten in your browser as you type, and nothing you paste leaves this page.

Try one

Converted here, in this tab. Nothing is sent anywhere.

On Antimatterread as Python

import os
from openai import OpenAI
 
client = OpenAI(base_url="https://useantimatter.com/v1", api_key=os.environ["ANTIMATTER_API_KEY"])
 
completion = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[{"role": "user", "content": "Write a haiku about recursion."}],
)
print(completion.choices[0].message.content)
  1. Line 1Added the import the key needs.
  2. Line 4The base URL is now https://useantimatter.com/v1: the client used OpenAI's by default.
  3. Line 4The key comes from ANTIMATTER_API_KEY: the client read OpenAI's variable on its own before.
  4. Line 7gpt-4o-mini is openai/gpt-4o-mini here, the one model that fits.

It changes the base URL, the key and model ids, and names what else differs. Read the result before you run it.

Antimatter