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

# POST /admin/api/models



## OpenAPI

````yaml /generated/openapi.json post /admin/api/models
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /admin/api/models:
    post:
      tags:
        - Management
      summary: POST /admin/api/models
      parameters:
        - description: Administrative scope selected by the caller.
          in: header
          name: x-gproxy-admin-scope
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_ModelWrite'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_ModelDto'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_Envelope'
          description: Gateway error
      security:
        - consoleSession: []
        - bearer: []
        - anthropicKey: []
        - googleKey: []
components:
  schemas:
    Input_ModelWrite:
      properties:
        id:
          default: null
          type:
            - string
            - 'null'
        metadata:
          default: null
        name:
          type: string
        vocabularyFileId:
          default: null
          type:
            - string
            - 'null'
      required:
        - name
      type: object
    Output_ModelDto:
      properties:
        id:
          type: string
        metadata: true
        name:
          type: string
        priceRules:
          description: >-
            Saved, enabled rules matching this model, in billing precedence
            order.
          items:
            $ref: '#/components/schemas/Output_PriceRuleDto'
          type:
            - array
            - 'null'
        providers:
          default: []
          items:
            $ref: '#/components/schemas/Output_CatalogProviderDto'
          type: array
        vocabularyFileId:
          type:
            - string
            - 'null'
      required:
        - providers
        - id
        - name
        - metadata
        - vocabularyFileId
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_PriceRuleDto:
      properties:
        currency:
          description: ISO 4217, three letters.
          type: string
        enabled:
          type: boolean
        id:
          type: string
        modelPattern:
          description: A `*`/`?` glob over the upstream model name.
          type: string
        operation:
          description: None covers every operation of the matched model.
          type:
            - string
            - 'null'
        priority:
          format: int32
          type: integer
        providerId:
          description: None prices every provider; a provider rule wins over a global one.
          type:
            - string
            - 'null'
      required:
        - id
        - providerId
        - modelPattern
        - operation
        - priority
        - currency
        - enabled
      type: object
    Output_CatalogProviderDto:
      properties:
        displayName:
          type:
            - string
            - 'null'
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
        - displayName
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey
    consoleSession:
      in: cookie
      name: gproxy_session
      type: apiKey

````

## Related topics

- [POST /admin/api/models/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodelsbatch.md)
- [POST /admin/api/models/discover](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodelsdiscover.md)
- [POST /admin/api/models/test](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodelstest.md)
- [POST /admin/api/models/discover/apply](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodelsdiscoverapply.md)
- [POST /admin/api/provider-models](https://gproxy.leenhawk.com/api-reference/management/post-adminapiprovider-models.md)


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