Start Base URL and SDKs
Base URL and SDKs
The Mothpoint speaks both the OpenAI and the Anthropic API, so the SDKs you already use work once their base URL points here.
Base URL
https://api.runmoth.si/v1Keyyour
moth_ key, as the SDK's API keyModelany chat model ID from the catalog, while image, video and music models run as a job
OpenAI SDKs
python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.runmoth.si/v1", api_key=os.environ["MOTH_API_KEY"])
reply = client.chat.completions.create(
model="gemini-3.8-flash",
messages=[{"role": "user", "content": "Hello"}],
)typescript
import OpenAI from "openai";
const apiKey = process.env.MOTH_API_KEY;
if (!apiKey) throw new Error("Set MOTH_API_KEY");
const client = new OpenAI({ baseURL: "https://api.runmoth.si/v1", apiKey });
const reply = await client.chat.completions.create({
model: "gemini-3.8-flash",
messages: [{ role: "user", content: "Hello" }],
});They cover chat completions, streaming, tools and the model list. Embeddings, audio, files and OpenAI's own images and Responses APIs aren't served, and media runs as a job instead.
Anthropic SDKs
The Anthropic SDKs add /v1 themselves, so their base URL is https://api.runmoth.si. Every chat model answers in this format too, including the ones whose makers don't speak it.
python
import os
from anthropic import Anthropic
client = Anthropic(base_url="https://api.runmoth.si", api_key=os.environ["MOTH_API_KEY"])
reply = client.messages.create(
model="gemini-3.8-flash",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)