---
title: "Create a Smart Router"
method: POST
path: "/v1/org/auto-routers"
tags: ["Inference Providers"]
---

# Create a Smart Router

`POST /v1/org/auto-routers`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/org/auto-routers`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Creates a Smart Router: its name and its AI Gateway models in order, each with the tasks it handles (at least one). It applies to nobody until who it applies to is set with PUT /v1/org/auto-routers/{routerId}/assignment. Tasks are shared across the organization and matched case-insensitively; new names are created. The first model wins ties and is used when the router cannot decide. Refused with auto_router_not_configured while the AI Gateway has no TypeSafe key. Requires the Manage Gateway providers permission and a recent sign-in. Returns the whole list and the new router's id.

## Request body

- AutoRouterWrite
  - `name` string, required
  - `models` AutoRouterModelWrite[], required
    - `providerId` string, required
    - `modelId` string, required
    - `tasks` string[], required

## Response `200`

Smart Router created.

- AutoRouterSaved
  - `routing` 'ready' | 'missing_key' | 'unknown', required
  - `canEdit` boolean, required
  - `routers` AutoRouter[], required
    - `id` string, required
    - `name` string, required
    - `assignment` AutoRouterAssignment, required
      - `everyone` boolean, required
      - `teamIds` string[], required
      - `memberIds` string[], required
    - `models` AutoRouterModel[], required
      - `id` string, required
      - `providerId` string, required
      - `modelId` string, required
      - `tasks` string[], required
    - `updatedAt` string, date-time, required
  - `tasks` string[], required
  - `routerId` string, required

## Other responses

- `400`: The request is invalid (for example a model without tasks), or names a model the AI Gateway does not offer.
- `401`: Authentication required.
- `403`: The caller lacks the Manage Gateway providers permission or needs to sign in again.
- `404`: The organization or Smart Router was not found.
- `409`: Refused because the AI Gateway has no routing (TypeSafe) key.

## Changes

- **2026-10-30** `b2ee4fa3a945`: 1 warning, 1 info
  - removed the request property `assignment`
  - added the required property `routerId` to the response with the `200` status
- **2026-10-30** `6f5c1dff0f3f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/auto-routers/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
