SDKs & OpenAI compatibility
Keep the OpenAI or Anthropic client you already have and change one URL — there is no separate Yelno SDK to install.
Official SDKs
OpenAI compatibility
Attribute a request to a project with the OpenAI-Project header (or X-Yelno-Project) carrying the project id from the console — the OpenAI SDKs send it when you pass project=. It works with an organization-wide key and must name a project of the key's own organization; a key scoped to a project always uses that project. OpenAI-Organization is checked against the key and never selects an organization.
Point any OpenAI SDK at https://yelno.ai/v1. Model ids use the creator/model form. Route evidence and cost are returned in an additive yelno object that existing clients ignore, and every response carries an X-Request-Id header. Routing is not chosen per request: your organization's policy applies (/console/routing).
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://yelno.ai/v1",
apiKey: process.env.YELNO_API_KEY,
// no routing header: the organization policy in /console/routing applies to every request
});
const res = await client.chat.completions.create({
model: "mistral/mistral-large-2",
messages: [{ role: "user", content: "ping" }],
});
const { provider, attempts, cost } = (res as any).yelno; // additive; typed clients ignore it
console.log(provider, attempts[0].region, cost.customer_nanos, cost.state); // mistral eu-west 46000 final