---
title: "Create model provider config"
method: POST
path: "/orgs/{orgID}/model-provider-configs"
tags: ["Models"]
---

# Create model provider config

`POST /orgs/{orgID}/model-provider-configs`

## Request

- Base URL: `https://api.omnara.com/v1`
- URL: `https://api.omnara.com/v1/orgs/{orgID}/model-provider-configs`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-omnara_session` and API key in header `X-Omnara-Csrf`

Create a model provider config, validate the configured credential where the provider exposes a validation endpoint, then probe the provider's /models endpoint. The result is returned as model_catalog; a failed probe does not fail creation.

## Path parameters

- `orgID` string, required

## Request body

- CreateModelProviderConfigRequest: Connect Omnara to a model API endpoint. Use a preset for built-in providers, or provide api_format and base_url for a custom endpoint. When omitted, endpoint_path and auth settings are filled from api_format.
  - `name` string, required: Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.
  - `preset` 'openai' | 'openrouter' | 'anthropic' | 'openlake': Built-in provider settings: openai, openrouter, anthropic, or openlake. A preset fills in api_format, api_variant, base_url, endpoint_path, auth_kind, and auth_options, so omit those when using one.
  - `api_format` 'openai-responses' | 'openai-chat-completions' | 'anthropic-messages': Wire protocol the model endpoint speaks.
  - `api_variant` 'default' | 'openrouter' | 'bedrock': Provider-specific variant of api_format. Use default unless the endpoint is OpenRouter or Bedrock.
  - `base_url` string: Provider endpoint base URL.
  - `endpoint_path` string: URL path under base_url. Defaults to /responses for OpenAI Responses, /chat/completions for Chat Completions, and /messages for Anthropic Messages.
  - `request_timeout_ms` integer: Total deadline for one provider attempt, including reasoning and response streaming, in milliseconds. Defaults to 3600000 (60 minutes). Retries have separate deadlines.
  - `idle_timeout_ms` integer: Maximum wait for response headers or the next response bytes, in milliseconds. Heartbeats count as activity. Defaults to 300000 (5 minutes). Local response processing does not consume this idle budget.
  - `auth_kind` 'bearer_token' | 'api_key_header' | 'sigv4': How the credential is sent: as a bearer token, in the header named by auth_options.header_name, or signed with AWS SigV4.
  - `auth_options` object: Non-secret authentication settings. Use an empty object with bearer_token. With api_key_header, set {"header_name":"..."}; Anthropic Messages defaults to {"header_name":"x-api-key"}. With sigv4, set the AWS signing service and region.
    - `header_name` string: Header that carries the API key when auth_kind is api_key_header.
    - `service` string: AWS service to sign for when auth_kind is sigv4.
    - `region` string: AWS region to sign for when auth_kind is sigv4.
  - `credential_secret_id` string, required: Secret ID (sec_...).
  - `headers` object: Extra HTTP headers sent with every request to this provider. Values are stored and returned as plain text; use secret_headers for keys and tokens.
  - `secret_headers` object: Extra HTTP headers whose values come from org-owned generic secrets, mapping header names to secret references.

## Response `201`

Created route response.

- CreateModelProviderConfigResponse
  - `config` ModelProviderConfig, required
    - `id` string, required: Identifies this provider config.
    - `org_id` string, required: Organization that owns this provider config.
    - `management_kind` 'tenant' | 'cluster', required: Whether the organization manages this provider or the Omnara installation provisions and manages it.
    - `name` string, required: Name agent configs use to reference this provider as model.provider_config.
    - `api_format` 'openai-responses' | 'openai-chat-completions' | 'anthropic-messages', required: Wire protocol Omnara speaks to this provider.
    - `api_variant` string, required: Provider-specific flavor of the API format.
    - `base_url` string, required: Provider endpoint base URL.
    - `endpoint_path` string, required: Path under base_url that model requests are sent to.
    - `request_timeout_ms` integer, required: Total deadline for one provider attempt, including reasoning and response streaming.
    - `idle_timeout_ms` integer, required: Longest wait for response headers or more response data; heartbeats count as activity.
    - `auth_kind` string, required: How Omnara sends the credential to the provider.
    - `auth_options` object, required: Non-secret authentication settings for this provider config.
      - `header_name` string: Header that carries the API key when auth_kind is api_key_header.
      - `service` string: AWS service to sign for when auth_kind is sigv4.
      - `region` string: AWS region to sign for when auth_kind is sigv4.
    - `credential_secret_id` string, required: Secret holding the credential Omnara sends to the provider.
    - `headers` object, required: Extra HTTP headers sent with every request to this provider.
    - `secret_headers` object, required: Extra HTTP headers whose values come from the referenced secrets.
    - `created_at` string, date-time, required: When the provider config was created.
    - `updated_at` string, date-time, required: When the provider config was last changed.
  - `model_catalog` ModelCatalog, required: The provider's model catalog, obtained by validating the configured credential and probing the provider's /models endpoint. A failed probe does not affect the stored config; treat it as a warning that the base URL or API key may be invalid.
    - `status` 'ok' | 'failed', required
    - `models` DiscoveredProviderModel[]: Models advertised by the provider, newest first, filtered to text-output tool-calling models where the provider exposes enough metadata to tell. Present when status is ok.
      - `slug` string, required: Provider model slug usable as a configured model's provider_model_slug.
      - `display_name` string
      - `context_window_tokens` integer: Provider-advertised context window limit in tokens, when available.
      - `max_output_tokens` integer: Provider-advertised maximum output limit in tokens, when available.
      - `supports_reasoning` boolean: Whether Omnara can send this model a reasoning effort, when the provider or the public model catalog reports it.
      - `supported_reasoning_efforts` string[]: Reasoning effort values the model accepts, when reported.
      - `pricing` DiscoveredModelPricing: Provider-advertised list prices, present only when the provider publishes pricing in its model catalog (OpenRouter).
        - `input_usd_per_million` string, required
        - `cache_read_input_usd_per_million` string
        - `cache_write_input_usd_per_million` string
        - `output_usd_per_million` string, required
    - `error` string: Why the probe failed. Present when status is failed.

## Other responses

- `400`: The request was invalid.
- `401`: Authentication is required or invalid.
- `403`: The authenticated principal is not authorized.
- `404`: The requested resource was not found or is not visible.
- `409`: The request conflicts with current resource state or idempotency history.
- `503`: The service dependency required to satisfy the request is unavailable.
- `4XX`: Any other client error. The body carries the shared Error envelope restricted to client error codes; statuses with a dedicated response above are documented precisely.
- `5XX`: Any other server error. The body carries the shared Error envelope restricted to server error codes.

## Changes

- **2026-11-19** `9ad66c726bff`: 1 info
  - added the new `openlake` enum value to the request property `preset`
- **2026-10-09** `482d7443803b`: 2 info
  - added the optional property `model_catalog/models/items/supported_reasoning_efforts` to the response with the `201` status
  - added the optional property `model_catalog/models/items/supports_reasoning` to the response with the `201` status
- **2026-10-05** `3d9e2cf46e07`: 159 info
  - added the optional property `current_digest` to the response with the `400` status
  - added the optional property `current_digest` to the response with the `401` status
  - added the optional property `current_digest` to the response with the `403` status
  - added the optional property `current_digest` to the response with the `404` status
  - …155 more
  - …this revision’s changelog is incomplete
- **2026-09-28** `acddeb8fc6a5`: 7 warning, 7 info
  - added the new `upstream_unavailable` enum value to the `code` response property for the response status `400`
  - added the new `upstream_unavailable` enum value to the `code` response property for the response status `401`
  - added the new `upstream_unavailable` enum value to the `code` response property for the response status `403`
  - added the new `upstream_unavailable` enum value to the `code` response property for the response status `404`
  - …10 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/omnara/apis/omnara-api-2/changes/orgs/:orgID/model-provider-configs/post.md)

---

[API](https://skmtc.dev/omnara/apis/omnara-api-2.md) - [All operations](https://skmtc.dev/omnara/apis/omnara-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/omnara/apis/omnara-api-2/revisions/343aebb1dff1?raw)
