> ## 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/test



## OpenAPI

````yaml /generated/openapi.json post /admin/api/models/test
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/test:
    post:
      tags:
        - Management
      summary: POST /admin/api/models/test
      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_ModelTest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_ModelTestResultDto'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_Envelope'
          description: Gateway error
      security:
        - consoleSession: []
        - bearer: []
        - anthropicKey: []
        - googleKey: []
components:
  schemas:
    Input_ModelTest:
      description: |-
        A real generation against one provider. It spends a real credential and
        writes a real usage row; there is no dry run.
      properties:
        credentialId:
          default: null
          description: |-
            The credential to spend. None lets the provider's usual selection
            choose, which is what a test of "does this provider work" wants.
          type:
            - string
            - 'null'
        model:
          description: The upstream model name, as the provider's catalog spells it.
          type: string
        providerId:
          type: string
      required:
        - providerId
        - model
      type: object
    Output_ModelTestResultDto:
      properties:
        credentialLabel:
          type:
            - string
            - 'null'
        error:
          type:
            - string
            - 'null'
        latencyMs:
          format: uint64
          minimum: 0
          type: integer
        model:
          type: string
        ok:
          type: boolean
        reply:
          type:
            - string
            - 'null'
        status:
          description: The upstream's HTTP status, or 0 when nothing was answered.
          format: uint16
          maximum: 65535
          minimum: 0
          type: integer
        usage:
          anyOf:
            - $ref: '#/components/schemas/Output_UsageTokensDto'
            - type: 'null'
          description: >-
            What the upstream reported it spent. Absent when it reported
            nothing,

            which is not the same as zero.
      required:
        - ok
        - latencyMs
        - status
        - model
        - usage
        - reply
        - credentialLabel
        - error
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_UsageTokensDto:
      description: Token counts exactly as the upstream reported them.
      properties:
        cacheCreation:
          items:
            $ref: '#/components/schemas/Output_CacheCreationDto'
          type: array
        cachedInputTokens:
          format: uint64
          minimum: 0
          type:
            - integer
            - 'null'
        inputTokens:
          description: Ordinary input, excluding cache reads and cache writes.
          format: uint64
          minimum: 0
          type:
            - integer
            - 'null'
        outputTokens:
          description: Total output, reasoning included.
          format: uint64
          minimum: 0
          type:
            - integer
            - 'null'
        reasoningTokens:
          description: A subset of `output_tokens`, never additive with it.
          format: uint64
          minimum: 0
          type:
            - integer
            - 'null'
      required:
        - inputTokens
        - outputTokens
        - cachedInputTokens
        - cacheCreation
        - reasoningTokens
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Output_CacheCreationDto:
      description: >-
        Reported cache writes for one retention duration. None means unknown
        TTL.
      properties:
        tokens:
          format: uint64
          minimum: 0
          type: integer
        ttlSeconds:
          format: uint64
          minimum: 0
          type:
            - integer
            - 'null'
      required:
        - tokens
        - ttlSeconds
      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

- [Models and routes](https://gproxy.leenhawk.com/guides/models.md)
- [POST /admin/api/credentials/{id}/models/test](https://gproxy.leenhawk.com/api-reference/management/post-adminapicredentials-modelstest.md)
- [POST /admin/api/models](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodels.md)
- [POST /admin/api/connectivity/test](https://gproxy.leenhawk.com/api-reference/management/post-adminapiconnectivitytest.md)
- [POST /admin/api/models/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodelsbatch.md)


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