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

# Get a routing policy

> Returns one routing policy: your personal one of that name if you have one, else the organization's (`scope=organization` reads the organization's even when a personal one shadows it). The `ETag` header carries its version, to send back as `If-Match` on a conditional replace. With a management key, the organization's policies are managed (`manage:read` to read, `manage:write` to write). With your own API key or session token, your personal policies are managed, and the organization's can be read.



## OpenAPI

````yaml https://api.edenai.run/v2/info/splitted-schema/management_api/openapi.json get /v3/manage/routing-policies/{name}/
openapi: 3.0.3
info:
  title: Organization Management
  version: '2.0'
  description: Your project description
servers:
  - url: https://api.edenai.run
security: []
paths:
  /v3/manage/routing-policies/{name}/:
    get:
      tags:
        - Routing Policies
      summary: Get a routing policy
      description: >-
        Returns one routing policy: your personal one of that name if you have
        one, else the organization's (`scope=organization` reads the
        organization's even when a personal one shadows it). The `ETag` header
        carries its version, to send back as `If-Match` on a conditional
        replace. With a management key, the organization's policies are managed
        (`manage:read` to read, `manage:write` to write). With your own API key
        or session token, your personal policies are managed, and the
        organization's can be read.
      operationId: manage_routing_policies_retrieve
      parameters:
        - in: path
          name: name
          schema:
            type: string
          description: The policy's handle, as called with `@edenai/{name}`.
          required: true
        - in: query
          name: scope
          schema:
            type: string
            enum:
              - organization
              - user
          description: >-
            Only policies of this scope: `user` for your personal ones,
            `organization` for the organization's. Without it, both. A
            management key only ever sees the organization's.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingPolicy'
          description: ''
      security:
        - ManagementKeyOrUserAuth: []
components:
  schemas:
    RoutingPolicy:
      type: object
      description: A routing policy as the management API returns it.
      properties:
        name:
          type: string
          readOnly: true
        scope:
          allOf:
            - $ref: '#/components/schemas/ScopeEnum'
          readOnly: true
          description: |-
            `organization` for a shared policy, `user` for a personal one.

            * `organization` - Organization
            * `user` - User
        description:
          type: string
          readOnly: true
        enabled:
          type: boolean
          readOnly: true
        strategy:
          readOnly: true
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/StrategyEnum'
            - $ref: '#/components/schemas/NullEnum'
        targets:
          type: array
          items:
            $ref: '#/components/schemas/PolicyTarget'
          nullable: true
          readOnly: true
        defaults:
          allOf:
            - $ref: '#/components/schemas/PolicyDefaults'
          readOnly: true
        lock:
          type: array
          items:
            $ref: '#/components/schemas/LockEnum'
          readOnly: true
        fallbacks:
          type: array
          items:
            type: string
          readOnly: true
        version:
          type: integer
          readOnly: true
        etag:
          type: string
          readOnly: true
          description: The version, as the `If-Match` header expects it.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          format: email
          readOnly: true
          nullable: true
          description: Email of the creator, or null for an API write.
        updated_by:
          type: string
          format: email
          readOnly: true
          nullable: true
          description: Email of the last editor, or null for an API write.
      required:
        - created_at
        - created_by
        - defaults
        - description
        - enabled
        - etag
        - fallbacks
        - lock
        - name
        - scope
        - strategy
        - targets
        - updated_at
        - updated_by
        - version
    ScopeEnum:
      enum:
        - organization
        - user
      type: string
      description: |-
        * `organization` - Organization
        * `user` - User
    StrategyEnum:
      enum:
        - fallback
        - load_balance
        - cheapest
        - fastest
      type: string
      description: |-
        * `fallback` - Fallback
        * `load_balance` - Load balance
        * `cheapest` - Cheapest
        * `fastest` - Fastest
    NullEnum:
      enum:
        - null
    PolicyTarget:
      type: object
      description: >-
        One candidate model and its per-target overrides. A plain string is
        ``{"model": …}``.
      properties:
        model:
          type: string
        weight:
          type: integer
          maximum: 100
          minimum: 1
        retries:
          type: integer
          maximum: 3
          minimum: 0
        credentials:
          $ref: '#/components/schemas/CredentialsEnum'
        routing:
          $ref: '#/components/schemas/RoutingPreferences'
        region:
          type: string
      required:
        - model
    PolicyDefaults:
      type: object
      description: Settings applied to every target unless the target overrides them.
      properties:
        routing:
          $ref: '#/components/schemas/RoutingPreferences'
        credentials:
          allOf:
            - $ref: '#/components/schemas/CredentialsEnum'
          default: auto
        retries:
          type: integer
          maximum: 3
          minimum: 0
          default: 0
    LockEnum:
      enum:
        - sort
        - sticky
        - allow_fallbacks
        - allowed_providers
        - ignored_providers
        - order
        - max_price
        - zero_data_retention
        - region
      type: string
      description: |-
        * `sort` - sort
        * `sticky` - sticky
        * `allow_fallbacks` - allow_fallbacks
        * `allowed_providers` - allowed_providers
        * `ignored_providers` - ignored_providers
        * `order` - order
        * `max_price` - max_price
        * `zero_data_retention` - zero_data_retention
        * `region` - region
    CredentialsEnum:
      enum:
        - auto
        - own
        - eden
      type: string
      description: |-
        * `auto` - auto
        * `own` - own
        * `eden` - eden
    RoutingPreferences:
      type: object
      description: >-
        The request ``routing`` object as a policy stores it. A ``null`` means
        unset: the

        field then comes from the request or the platform default.
      properties:
        sort:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/SortEnum'
            - $ref: '#/components/schemas/NullEnum'
        sticky:
          type: boolean
          nullable: true
        allow_fallbacks:
          type: boolean
          nullable: true
        allowed_providers:
          type: array
          items:
            type: string
            maxLength: 64
          nullable: true
        ignored_providers:
          type: array
          items:
            type: string
            maxLength: 64
          nullable: true
        order:
          type: array
          items:
            type: string
            maxLength: 64
          nullable: true
          maxItems: 16
        max_price:
          allOf:
            - $ref: '#/components/schemas/MaxPrice'
          nullable: true
        zero_data_retention:
          type: boolean
          nullable: true
    SortEnum:
      enum:
        - cost
        - speed
        - latency
        - exact
      type: string
      description: |-
        * `cost` - cost
        * `speed` - speed
        * `latency` - latency
        * `exact` - exact
    MaxPrice:
      type: object
      description: A per-million-token ceiling; at least one of the two sides.
      properties:
        input:
          type: number
          format: double
          minimum: 0
          nullable: true
        output:
          type: number
          format: double
          minimum: 0
          nullable: true
  securitySchemes:
    ManagementKeyOrUserAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        A management key (`mgmt-eden...`) to manage the organization's routing
        policies, or your own API key (`sk-eden...`) or session token to manage
        your personal ones, sent as `Authorization: Bearer <key>`.

````

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