Models Hub
Agent Tools

Oh My Pi

A terminal AI coding agent with support for thinking mode and reasoning effort level mapping.

Edit this page

Overview

Oh My Pi is a terminal AI coding agent that lets you add custom model providers through the models.yml configuration file. It supports thinking mode (reasoning effort), tool calling, and full context management.

📦 Before You Start

What you need

  • Oh My Pi installed (the omp command available)
  • A working Models Hub Base URL (for this tool, do not add the /v1 suffix when configuring; see the note below)
  • A working Models Hub API Key (generate it in the console)
  • The model name you want to use (such as claude-sonnet-4-6, gemini-2.5-flash, etc., which must match the model ID in the Models Hub console exactly)

🔑 Step 1: Set the Environment Variable

export MODELSOK_API_KEY="ms_live_your_key"

🔧 Step 2: Create the Configuration File

Create ~/.omp/agent/models.yml and add the Models Hub provider:

providers:
  modelsok:
    baseUrl: https://modelsok.com/v1
    api: openai-completions
    apiKey: MODELSOK_API_KEY
    authHeader: true
    models:
      - id: claude-sonnet-4-6
        name: Claude Sonnet 4.6
        reasoning: true
        thinking:
          minLevel: high
          maxLevel: xhigh
          mode: effort
        input: [text]
        contextWindow: 200000
        maxTokens: 128000
        compat:
          supportsDeveloperRole: false
          supportsReasoningEffort: true
          maxTokensField: max_tokens
          reasoningEffortMap:
            high: high
            xhigh: max
          supportsToolChoice: false
          requiresReasoningContentForToolCalls: true
          requiresAssistantContentForToolCalls: true
        extraBody:
          thinking:
            type: enabled
      - id: gemini-2.5-flash
        name: Gemini 2.5 Flash
        reasoning: false
        input: [text]
        contextWindow: 1000000
        maxTokens: 65536
        compat:
          supportsDeveloperRole: false
          maxTokensField: max_tokens

Key configuration notes

OptionDescription
baseUrlThe Models Hub Base URL. Write /v1 per the Models Hub standard (Oh My Pi handles path concatenation internally)
authHeader: trueSends Authorization: Bearer $MODELSOK_API_KEY
supportsDeveloperRole: falseSends the system prompt with the system role
maxTokensField: max_tokensUses max_tokens as the output limit field
supportsToolChoice: falseThe tool_choice parameter is not accepted in thinking mode
requiresReasoningContentForToolCalls: truereasoning_content must be preserved in the history messages of a tool call conversation
requiresAssistantContentForToolCalls: trueEnsures the content field of a tool call message is not empty

Important

The compat field in models.yml is replaced as a whole block; it is not merged with the built-in entries. You must write out all the fields you need—any missing fields are treated as their default values.

✅ Step 3: Launch and Verify

Go to your project directory and launch with the parameter:

cd /path/to/your-project
omp --model modelsok/claude-sonnet-4-6

When you need faster responses, switch to a non-reasoning model:

omp --model modelsok/gemini-2.5-flash

Inside Oh My Pi, press Ctrl+L at any time or type /model to switch models.

❓ FAQ

IssueSolution
Provider not found on startupCheck that the path ~/.omp/agent/models.yml is correct
401 UnauthorizedConfirm that MODELSOK_API_KEY is exported in the current shell
Tool call errors with a reasoning modelConfirm that requiresReasoningContentForToolCalls: true is enabled
Abnormal behavior after switching modelsFor non-reasoning models, disable reasoning: true and extraBody.thinking

On this page