Python SDK
OpenAI SDK-compatible. Swap one import β 420+ models with zero config changes. Works with Python 3.9+.
Sync & async clients. Pydantic types. SSE streaming. Auto-retry with exponential backoff.
$ pip install llmwate
$ pip install llmwate[async] # async support
Quick Example
from llmwate import LLMWate
client = LLMWate(api_key="your_key")
resp = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(resp["choices"][0]["message"]["content"])
Streaming
from llmwate import LLMWate
client = LLMWate(api_key="your_key")
for chunk in client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Write a haiku"}],
stream=True,
):
c = chunk.get("choices", [{}])[0].get("delta", {}).get("content")
if c: print(c, end="", flush=True)
Async
import asyncio
from llmwate import AsyncLLMWate
async def main():
client = AsyncLLMWate(api_key="your_key")
resp = await client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hi"}]
)
print(resp["choices"][0]["message"]["content"])
asyncio.run(main())
Vision
from llmwate import LLMWate
client = LLMWate(api_key="your_key")
resp = client.chat.completions.create(
model="openai/gpt-4o",
messages=[
{"role": "user", "content": "What is this?"},
{"role": "user", "content": "data:image/png;base64,..."}
]
)
print(resp["choices"][0]["message"]["content"])
Function Calling
from llmwate import LLMWate
client = LLMWate(api_key="your_key")
resp = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Weather in Tokyo?"}],
tools=[{"type": "function", "function": {
"name": "get_weather",
"parameters": {"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}}]
)
print(resp.choices[0].message.tool_calls)
JavaScript / TypeScript SDK
Node.js 18+ and modern browsers. Fully typed. ESM + CommonJS. First-class TypeScript support out of the box.
Drop-in replacement for the OpenAI SDK. Tree-shakeable. Works in Node, Bun, Deno, Vite, Webpack, and modern browsers.
$ npm install llmwate-sdk
$ yarn add llmwate-sdk
$ pnpm add llmwate-sdk
Quick Example
import { LLMWate } from 'llmwate-sdk';
const client = new LLMWate({
apiKey: process.env.LLMWATE_API_KEY,
});
const resp = await client.chat.completions.create({
model: 'openai/gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(resp.choices[0].message.content);
Streaming
const stream = await client.chat.completions.create({
model: 'openai/gpt-4o',
messages: [{ role: 'user', content: 'Write a story' }],
stream: true,
});
for await (const chunk of stream) {
const text = chunk.choices?.[0]?.delta?.content;
if (text) process.stdout.write(text);
}
Function Calling
const resp = await client.chat.completions.create({
model: 'openai/gpt-4o',
messages: [{ role: 'user', content: 'Weather in Tokyo?' }],
tools: [{ type: 'function', function: {
name: 'get_weather', parameters: {
type: 'object', properties: { city: { type: 'string' } },
required: ['city']
}
}}]
});
console.log(resp.choices[0].message.tool_calls);
Vision
const resp = await client.chat.completions.create({
model: 'openai/gpt-4o',
messages: [
{ role: 'user', content: 'What is this?' },
{ role: 'user', content: 'data:image/png;base64,...' }
]
});
console.log(resp.choices[0].message.content);
Go SDK
Idiomatic Go. context.Context first. Zero-allocation streaming. For backend services, CLIs, and edge functions.
Go 1.21+. Uses net/http. SSE via io.Reader. Full type safety with Go generics.
$ go get github.com/llmwate/llmwate-go
Quick Example
package main
import (
"context"
"fmt"
"github.com/llmwate/llmwate-go"
)
func main() {
client := llmwate.NewClient("your_key")
resp, err := client.Chat.Completions.Create(context.Background(), llmwate.ChatRequest{
Model: "openai/gpt-4o",
Messages: []llmwate.Message{
{Role: "user", Content: "Hello!"},
},
})
if err != nil { panic(err) }
fmt.Println(resp.Choices[0].Message.Content)
}
Streaming
stream, err := client.Chat.Completions.Stream(ctx, req)
if err != nil { panic(err) }
defer stream.Close()
for {
chunk, err := stream.Recv()
if err == io.EOF { break }
if err != nil { panic(err) }
fmt.Print(chunk.Choices[0].Delta.Content)
}
cURL & REST
Standard OpenAI-compatible HTTP API. Works with curl, fetch, Postman, Insomnia, or any HTTP client. No SDK needed.
POST to /v1/chat/completions. Bearer auth. SSE for streaming. Works from anywhere β bash scripts, ESP32, edge functions, Postman.
curl https://api.llmwate.com/v1/chat/completions \
-H "Authorization: Bearer $LLMWATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Drop-in OpenAI replacement
Same method signatures as the official OpenAI SDK. Replace openai with llmwate β no other code changes needed.
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
base_url="https://api.openai.com/v1"
)
chat = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hi"}]
)
from llmwate import LLMWate
client = LLMWate(api_key="your_llmwate_key")
chat = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hi"}]
)
# 420+ models! Same API.
Live API Explorer
Test any model right here. Your key never leaves the browser β requests go directly to our edge.
π§ͺ Sandbox Live
Enter your LLMWate API key, pick a model, and send a request. The full response is shown below in real time.
Enter your API key and click "Run Request" to test the API...
Supported providers
20+ providers, 420+ models β all through a single OpenAI-compatible API. No multi-vendor mess.
OpenAI
gpt-4o Β· o1 Β· o3-mini Β· gpt-4o-mini
Anthropic
claude-3.5-sonnet Β· claude-3-opus Β· claude-3-haiku
gemini-1.5-pro Β· gemini-1.5-flash Β· gemini-2.0
DeepSeek
deepseek-chat Β· deepseek-coder-v2 Β· deepseek-r1
Meta
llama-3.1-70b Β· llama-3.2 Β· codellama
Mistral AI
mistral-large Β· mixtral-8x7b Β· codestral
SiliconFlow
Pro Β· R1 series Β· Qwen Β· GLM
14 more
Groq Β· Cohere Β· Stability Β· Perplexityβ¦