
A single interface for OpenAI-compatible chat completions and the Anthropic Messages API, with native bindings for Rust, TypeScript, and Python.
Features
- One request model for OpenAI and Anthropic.
- Multimodal input — text, image, audio (OpenAI), and document (Anthropic) message parts.
- Structured JSON output via JSON Schema.
- Tool / function calling with provider-specific serialization.
- Streaming responses with text, tool, and reasoning deltas.
- Configurable retry policy for transient failures.
- Optional CLI (
llms) for quick testing.
Supported providers
| Provider | Endpoint style |
|---|---|
| OpenAI | https://api.openai.com/v1 |
| Anthropic | https://api.anthropic.com/v1 |
Pick your language
Rust
Native crate with full feature parity. Get started
TypeScript
NAPI-RS bindings for Node.js. Get started
Python
PyO3 bindings for Python 3.10+. Get started
Quick example
use llms_sdk::{LLM, LLMRequest, Message, MessagePart, MessageRole, TextPart};
let request = LLMRequest::builder()
.api_key(std::env::var("OPENAI_API_KEY")?)
.messages(vec![Message {
role: MessageRole::User,
content: vec![MessagePart::Text(TextPart::new("Hello!"))],
}])
.model("gpt-5.4-mini")
.build();
let llm = LLM::default();
let response = llm.respond(request).await?;import { Llm, ApiType, MessageRole } from '@cle-does-things/llms-sdk'
const request = {
apiType: ApiType.OpenAI,
apiKey: process.env.OPENAI_API_KEY!,
model: 'gpt-5.4-mini',
messages: [{
role: MessageRole.User,
content: [{ text: 'Hello!', type: 'text' }],
}],
stream: false,
parallelToolCalls: false,
}
const llm = new Llm()
const response = await llm.respond(request)from llms_sdk_py import LLMRequest, Message, TextPart, LLM
request = LLMRequest(
model="gpt-5.4-mini",
api_key="sk-...",
messages=[Message("user", [TextPart("Hello, world!")])],
stream=False,
)
client = llm.LLM()
response = await client.respond(request)