Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
Get started

Quickstart

Send one call through Mubit and find its request and reply in the console.

Before you start. Run the example in a bash or zsh terminal on your computer or a server, not in a browser. You need Python 3.10+, Node.js 22+ or curl, and an inference key for your project. If you can't create keys or choose how calls are paid, ask an admin of your organization.

1. Set up in the console

Open app.mubit.ai and sign in. Complete the first-time setup if prompted.

On Get started, create a Mubit key. It gets the permission Inference: calls this project. Copy it when shown, then set it in the terminal where you will run the example:

export MUBIT_API_KEY='YOUR_MUBIT_KEY'

Under Choose how calls are paid, select Use the starter credit if it's offered, or Add your provider key. The console names the providers the starter credit covers; for any other provider, add its API key. See Provider-key setup.

2. Send one call

Choose your provider and language below. The example uses Mubit's base URL and your Mubit key; keep the model ID you want to call. Use the base URL your console's Connect page shows.

ℹ️Note

Mubit records request and reply content by default. Use synthetic data for this example, and keep secrets out of prompts.

On the starter credit, use a model it serves, such as gpt-6-luna. For other models or options, add your own OpenAI key. See On the starter credit and Connect with the OpenAI SDK.

Create a virtual environment and install the SDK:

python3 -m venv .venv && source .venv/bin/activate
pip install openai

Save this as mubit-quickstart.py:

mubit-quickstart.py
import os
from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.mubit.ai/openai/v1",
    api_key=os.environ["MUBIT_API_KEY"],
)
 
instructions = (
    "Sort the support message into one category: "
    "billing, bug, account or other. Reply with the category only."
)
 
response = client.chat.completions.create(
    model="gpt-6-luna",
    messages=[
        {"role": "system", "content": instructions},
        {"role": "user", "content": "I was charged twice for my October invoice."},
    ],
)
print(response.choices[0].message.content)

Run it:

python mubit-quickstart.py

3. Check the result

For this support message, a successful reply should classify it as billing; exact output can vary.

In the console, open Requests and select your newest call. Check its Request, Reply and Served by details. Only calls made through the configured client go through Mubit.

If the call fails, use its error code to find the fix.

Next

Create your first adapter

Send examples of one task, follow its training, and compare a passing version with your provider model.