OpenAI SDK with Veil API
OpenAI SDK talks to Veil API in the OpenAI format. Change two settings and every Veil model is available.
Setup
- Create a Veil API key. Open the console
- Install OpenAI SDK as usual.
- Point its base URL at Veil and use your Veil key, as below.
from openai import OpenAI
client = OpenAI(base_url="https://api.veil.ir/v1", api_key=VEIL_API_KEY)
client.chat.completions.create(model="anthropic/claude-haiku-5-5", messages=[{"role": "user", "content": "Hello"}])
// TypeScript
const client = new OpenAI({ baseURL: "https://api.veil.ir/v1", apiKey: process.env.VEIL_API_KEY });Which model
Any model id from the models page works. Veil routes it and bills it at its list price.