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)
4 changes
- Line 1Added the import the key needs.
- Line 4The base URL is now https://useantimatter.com/v1: the client used OpenAI's by default.
- Line 4The key comes from ANTIMATTER_API_KEY: the client read OpenAI's variable on its own before.
- Line 7gpt-4o-mini is openai/gpt-4o-mini here, the one model that fits.
Then
- Get a key and set it as ANTIMATTER_API_KEY.
- Find the model id for anything left as written.
- Using Cursor, Claude Code, Aider or another tool? Setup for each.
It changes the base URL, the key and model ids, and names what else differs. Read the result before you run it.