omp Custom Provider Setup

Add TokenHub to omp models.yml and select a compatible model for a safe first coding task.

What is omp (Oh My Pi)?

omp, also known as Oh My Pi, is a terminal coding agent with built-in and custom model providers.

This omp guide declares a TokenHub OpenAI-compatible provider in models.yml. The API key is resolved from an environment variable, and the model context and output values must match the selected model. The models.yml file controls the provider transport, environment-backed credential, model ID, context window, and maximum output. YAML indentation or copied limits can prevent loading or produce invalid requests, so inspect the provider with omp models and test a small read-only task before using it on active work.

omp combines its bundled catalog, ~/.omp/agent/models.yml, runtime discovery, and extension-registered models into one registry. TokenHub is a custom models.yml provider and is selected as tokenhub/<model-id>.

Step 1: set a credential omp can resolve

export TOKENHUB_API_KEY="sk-..."

apiKey is resolved as either an environment-variable name or a literal value. If TOKENHUB_API_KEY exists, omp uses its value; otherwise it sends that text as the key. Confirm the variable exists after configuring it.

Step 2: edit ~/.omp/agent/models.yml

providers:
  tokenhub:
    baseUrl: __API_BASE_URL__/v1
    api: openai-completions
    apiKey: TOKENHUB_API_KEY
    authHeader: true
    models:
      - id: YOUR_TOKENHUB_MODEL_ID
        name: TokenHub / YOUR_TOKENHUB_MODEL_ID
        contextWindow: 128000
        maxTokens: 8192

authHeader: true injects Authorization: Bearer <key> on each request. Replace contextWindow and maxTokens with the values for that exact TokenHub model.

Step 3: check that the provider is loaded and available

omp models
omp models find YOUR_TOKENHUB_MODEL_ID

A model can enter omp's registry without becoming selectable. The official availability rule is that its provider is not in the effective disabledProviders list and is either keyless or has resolvable credentials. A valid key cannot restore the provider while tokenhub remains disabled.

Resolve credential conflicts in omp's precedence order

For multiple credentials on one provider, omp checks runtime --api-key, the models.yml apiKey, a local auth-store API key, OAuth, the provider environment variable, and finally the custom-provider fallback. Pinning TokenHub's key in models.yml takes precedence over stale OAuth, which is appropriate for a custom Base URL.

For a first test, choose tokenhub/YOUR_TOKENHUB_MODEL_ID, run a read-only task, and inspect TokenHub logs. If the provider is absent, inspect YAML and disabledProviders. If it is present but unselectable, inspect key resolution. For a 401, check the variable and authHeader; for a 400, check capabilities and token limits.

Official reference

Choose a compatible omp model

WorkloadModel choiceWhy it fits
Complex coding tasksA tool-capable reasoning modelUse a model with reliable tool use, streaming, and the context length your workflow needs.
Daily implementationA balanced coding modelPrioritize reliable edits and useful latency for normal coding loops.
Background and subagent workA fast, lower-cost modelUse this for iterations, summaries, and simpler work only after validating tool use.
Browse TokenHub models and compatibility

omp (Oh My Pi) provider FAQ

What should apiKey contain in models.yml?

Use TOKENHUB_API_KEY. When that environment variable exists, omp resolves its value as the provider key.

Why is my custom provider unavailable?

Check models.yml syntax, make sure the provider is not in disabledProviders, and confirm the API key variable is available to omp.

Can I copy context values from another model?

No. Declare the actual contextWindow and maxTokens for the TokenHub model you selected.

Are omp and Oh My Pi the same tool here?

Yes. This page covers the Oh My Pi terminal coding agent and its ~/.omp/agent/models.yml provider configuration.

How do I verify omp is using TokenHub?

Run omp models, select tokenhub/<model-id>, execute a read-only task, and confirm the exact model in TokenHub logs.

References

This setup is based on TokenHub and official documentation, last verified on 2026-09-08.