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

# Delete Policy

> Delete a policy. `default` cannot be deleted. If it was the default policy, settings fall back to `default`.



## OpenAPI

````yaml DELETE /router/policies/{policy_id}
openapi: 3.0.1
info:
  title: Electron Hub API
  description: >-
    Unified API platform integrating 200+ AI models for chat, image generation,
    speech-to-text, embeddings, and more.
  version: 1.0.0
  contact:
    name: Electron Hub Support
    email: support@electronhub.ai
    url: https://discord.com/invite/electronhub
  license:
    name: MIT
servers:
  - url: https://api.electronhub.ai/v1
    description: Production API v1
security:
  - bearerAuth: []
paths:
  /router/policies/{policy_id}:
    delete:
      tags:
        - Router
      summary: Delete policy
      description: >-
        Delete a policy. `default` cannot be deleted. If it was the default
        policy, settings fall back to `default`.
      operationId: deleteRouterPolicy
      parameters:
        - name: policy_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z0-9-]{1,40}$
          example: work
        - name: expected_version
          in: query
          required: false
          schema:
            type: integer
          description: >-
            Fail with 409 when the stored version differs. Can also be sent in
            the body.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deleted'
              example:
                deleted: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Body must be an object.
                  type: invalid_request_error
                  param: null
                  code: 400
        '403':
          description: Proxy keys cannot manage Router settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Only master keys can manage Router settings.
                  type: error
                  param: null
                  code: 403
        '404':
          description: Policy not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Router policy “missing” was not found.
                  type: router_policy_not_found
                  param: null
                  code: 404
        '409':
          description: Version conflict. `current` holds the stored document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Version conflict
                  type: router_conflict
                  param: null
                  code: 409
                current:
                  policy:
                    policyId: work
                    name: Work
                    schemaVersion: 4
                    mode: auto
                    auto:
                      costTier: high
                      qualityFloor: 0
                      preferFast: false
                      preferVendor: null
                      preferStrength: 0
                      maxTtft: 0
                      perCategory: {}
                    custom:
                      rules: []
                      default:
                        - action: useAuto
                    models:
                      allowed: []
                      excluded:
                        - '*:free'
                      strictAllowed: false
                    guardrails:
                      maxCostPerReq: null
                      blockOverCost: false
                      budgetUsd: 5
                      budgetWindow: daily
                      budgetScope: routed
                      blockOverBudget: false
                      pii:
                        enabled: false
                        action: block
                        model: null
                        entities: {}
                        labels: {}
                        custom: []
                        scanAll: false
                    cache:
                      enabled: false
                      ttlMin: 1440
                      maxEntries: 100
                      semantic: false
                      semanticThreshold: 0.9
                  version: 4
                  updatedAt: '2026-11-08T07:34:14.937184Z'
                  updatedBy: client
        '429':
          description: More than 60 Router writes in a minute
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Too many Router changes. Retry in a minute.
                  type: rate_limit_exceeded
                  param: null
                  code: 429
components:
  schemas:
    Deleted:
      type: object
      properties:
        deleted:
          oneOf:
            - type: boolean
            - type: integer
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API key (starts with 'ek-')

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.