Paper Instruments
Ultramarine API

Quickstart

Create a key and stream your first response.

Use the OpenAI SDK:

SettingValue
Base URLhttps://api.paperinstruments.com/v1
Modelultramarine-1-flash

Important: retune your prompts for Ultramarine

Ultramarine is behaviorally different from OpenAI and Anthropic models. With prompts tuned for them it can overdeliver to the point of verbosity, so fork your prompts and retune them for Ultramarine before you evaluate it. See Prompt Tuning for what to change.

Important: recommended configuration

We default to max thinking (reasoning effort) and recommend it for best results. Use stream=true for streaming. The recommended sampling defaults are temperature=1, top_p=0.95, and, for Chat Completions and Messages, top_k=-1 (disabled). Omit sampling fields to use these defaults. Responses does not accept top_k.

Read Default Sampling Config for settings by API, Prompt Tuning for prompt changes, and Packages for the code-execution environment.

Create a key

Sign in to the console, add funds on Billing, then create a key on API keys. Export the key:

export PAPERINSTRUMENTS_API_KEY="pi_live_..."

Send a request

pip install -U openai
example.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.paperinstruments.com/v1",
    api_key=os.environ["PAPERINSTRUMENTS_API_KEY"],
)

stream = client.chat.completions.create(
    model="ultramarine-1-flash",
    messages=[{"role": "user", "content": "Explain EBITDA in two sentences."}],
    reasoning_effort="max",
    max_completion_tokens=8192,
    stream=True,
)
for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="", flush=True)

Run python example.py.

Read reasoning text from delta.reasoning_content. The examples print delta.content. The 8,192-token limit includes both; increase it for responses with finish_reason: "length".

Sticky routing and caching

You can use the optional x-session-id header for sticky routing across conversation turns. See Sticky sessions for examples for all three APIs and how routing affects cache reuse.

Prompt tuning and packages

With prompts tuned for other models, Ultramarine can overdeliver to the point of verbosity, so give it its own version of your prompt. Prompt Tuning lists the changes that matter most. For Word, PowerPoint, and Excel work, give the model the Paper packages.

Next steps

On this page