Merkium

Search Merkium

Integrations

opencode and SDKs

Because the API is OpenAI-compatible, most tools that accept a custom OpenAI base URL work with Merkium. These setups have been tested against the live API.

opencode

opencode supports custom providers through its config. Add Merkium to opencode.json in your project, or to your global opencode config:

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "merkium": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Merkium",
      "options": {
        "baseURL": "https://chat.merkium.nl/api/v1",
        "apiKey": "{env:MERKIUM_API_KEY}"
      },
      "models": {
        "ganymede-1.1": {
          "name": "Ganymede 1.1",
          "limit": {
            "context": 1000000,
            "output": 16384
          }
        }
      }
    }
  },
  "model": "merkium/ganymede-1.1"
}
  • merkium is the provider ID. The model is referenced as merkium/ganymede-1.1.
  • npm is @ai-sdk/openai-compatible, the package opencode uses for /chat/completions providers.
  • options.apiKey reads the key from the MERKIUM_API_KEY environment variable.
  • limit tells opencode the context window and output limit, taken from GET /models.

Then export your key and start opencode. Run /models to switch models.

Shell
export MERKIUM_API_KEY="your-api-key"
opencode

OpenAI Python SDK

Shell
pip install openai
Python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://chat.merkium.nl/api/v1",
    api_key=os.environ["MERKIUM_API_KEY"],
)

response = client.chat.completions.create(
    model="ganymede-1.1",
    messages=[{"role": "user", "content": "Name one moon of Jupiter."}],
)
print(response.choices[0].message.content)

# Streaming
stream = client.chat.completions.create(
    model="ganymede-1.1",
    messages=[{"role": "user", "content": "Count to three."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

OpenAI JavaScript SDK

Shell
npm install openai
JavaScript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://chat.merkium.nl/api/v1",
  apiKey: process.env.MERKIUM_API_KEY,
});

const response = await client.chat.completions.create({
  model: "ganymede-1.1",
  messages: [{ role: "user", content: "Name one moon of Jupiter." }],
});
console.log(response.choices[0].message.content);

// Streaming
const stream = await client.chat.completions.create({
  model: "ganymede-1.1",
  messages: [{ role: "user", content: "Count to three." }],
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Vercel AI SDK

Use the @ai-sdk/openai-compatible provider with the ai package.

Shell
npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const merkium = createOpenAICompatible({
  name: "merkium",
  baseURL: "https://chat.merkium.nl/api/v1",
  apiKey: process.env.MERKIUM_API_KEY,
});

const { text, reasoningText } = await generateText({
  model: merkium("ganymede-1.1"),
  prompt: "Name a moon of Saturn.",
});

console.log(text);

reasoningText holds the model's reasoning. See Reasoning.

Other clients

For any other client that supports a custom OpenAI endpoint, use these settings:

Base URL
https://chat.merkium.nl/api/v1
API key
Your Merkium API key, sent as a Bearer token
Model
ganymede-1.1, or any ID from GET /models
API type
Chat Completions (/chat/completions)

Questions or problems with the API: mail@merkium.nl. Last verified against the live API on October 20, 2026.