> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete router

> Delete a router by router ID.



## OpenAPI

````yaml delete /router/v1/routers/{router_id}
openapi: 3.0.0
info:
  title: Router API
  version: v1
  description: >-
    Intelligent routing and optimization for LLM requests. Automatically selects
    the best model based on your criteria, handles fallbacks, and optimizes for
    cost, latency, or intelligence. Also includes a Router CRUD API for creating
    reusable routing configurations.
servers:
  - url: https://api.inworld.ai
    description: Production server
security:
  - inworld_basic: []
tags:
  - name: Chat Completions
    description: >-
      Main API endpoint for intelligent LLM routing and optimization. Generate
      chat completions with automatic model selection or specific models with
      fallbacks.
  - name: Moderations
    description: >-
      Classify text content for harmful material. Includes OpenAI-compatible
      moderation and conversation-aware chat moderation with AILuminate safety
      signals.
  - name: Router Management
    description: >-
      Service endpoints for creating and managing reusable router
      configurations. Use these to set up routing strategies that can be
      referenced in Chat Completions requests.
paths:
  /router/v1/routers/{router_id}:
    delete:
      tags:
        - Router Management
      summary: Delete router
      description: Delete a router by ID.
      operationId: RouterService_DeleteRouter
      parameters:
        - name: router_id
          in: path
          required: true
          schema:
            type: string
          description: Router ID.
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            text/plain:
              schema:
                type: string
                example: Unauthorized
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl --location --request DELETE
            'https://api.inworld.ai/router/v1/routers/<router_id>' \

            --header "Authorization: Basic $INWORLD_API_KEY"
        - lang: python
          label: Python
          source: |-
            import os
            import requests

            router_id = "<router_id>"
            url = f"https://api.inworld.ai/router/v1/routers/{router_id}"
            headers = {
                "Authorization": f"Basic {os.getenv('INWORLD_API_KEY')}"
            }

            response = requests.delete(url, headers=headers)
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: |-
            const routerId = '<router_id>';
            const url = `https://api.inworld.ai/router/v1/routers/${routerId}`;

            const response = await fetch(url, {
              method: 'DELETE',
              headers: {
                'Authorization': `Basic ${process.env.INWORLD_API_KEY}`,
              },
            });

            const data = await response.json();
            console.log(data);
components:
  schemas:
    Empty:
      type: object
      description: Empty response.
  securitySchemes:
    inworld_basic:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your [authentication](../../../api-reference/introduction) credentials.
        For Basic authentication, please populate `Basic $INWORLD_API_KEY`.


        Please make sure your API Key has [write permissions for the Router
        API](/api-reference/introduction#getting-an-api-key) in order to create,
        update, and delete routers.

````