Get started / SDKs

# 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

| Language | Install | Version | Notes |
| --- | --- | --- | --- |
| Python | pip install openai | ≥ 1.0 | OpenAI(base_url=…, api_key=…); yelno via res.model_extra |
| TypeScript / Node | npm install openai | ≥ 4.0 | new OpenAI({ baseURL, apiKey }); edge-runtime safe |
| Go | go get github.com/openai/openai-go | ≥ 1.0 | option.WithBaseURL(…), option.WithAPIKey(…) |
| Java / Kotlin | com.openai:openai-java | ≥ 1.0 | OpenAIOkHttpClient.builder() with baseUrl(…) and apiKey(…) |
| .NET | dotnet add package OpenAI | ≥ 2.0 | OpenAIClientOptions { Endpoint = … } |
| Anthropic SDKs | pip install anthropic · npm install @anthropic-ai/sdk | latest | base_url https://yelno.ai → POST /v1/messages |

## 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](https://yelno.ai/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
```

## Frameworks

LangChain / LangGraph

ChatOpenAI(base_url=…, api_key=…) with a creator/model id

Vercel AI SDK

createOpenAI({ baseURL, apiKey }) from @ai-sdk/openai · streaming and tool calls

LlamaIndex

OpenAILike(api_base=…) LLM and OpenAIEmbedding(api_base=…)

Spring AI

spring.ai.openai.base-url=https://yelno.ai

Pydantic AI

OpenAIProvider(base_url=…) with the OpenAI chat model class

Any OpenAI client

Change baseURL; nothing else

What differs from OpenAI Cost arrives in the response's `yelno.cost` with a `state` (final or provisional), never in headers. Parameters no eligible endpoint supports are omitted and reported in `warnings[]` by default (`compat_mode: "permissive"`); send `compat_mode: "strict"` to get a 422 naming the parameter before any provider is contacted.

Source: https://yelno.ai/docs/sdks
