> ## 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 /v1/decisions

> Available at the instance root or under a provider/namespace prefix. Shared paths select the wire dialect from client headers; without dialect evidence, the first listed route wins.



## OpenAPI

````yaml /generated/openapi.json post /v1/decisions
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:
  /v1/decisions:
    post:
      tags:
        - Forwarding
      summary: POST /v1/decisions
      description: >-
        Available at the instance root or under a provider/namespace prefix.
        Shared paths select the wire dialect from client headers; without
        dialect evidence, the first listed route wins.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_CreateDecisionRequestBody'
        required: true
      responses:
        2XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_CreateDecisionResponseBody'
          description: Successful protocol response
        default:
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Output_Envelope'
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_ErrorDetail'
                    required:
                      - error
                    type: object
                  - allOf:
                      - $ref: '#/components/schemas/Output_ErrorEvent'
                      - properties:
                          type:
                            const: error
                        required:
                          - type
                        type: object
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_GenerateContentError'
                    required:
                      - error
                    type: object
            text/plain:
              schema:
                type: string
          description: Gateway or upstream error
components:
  schemas:
    Input_CreateDecisionRequestBody:
      additionalProperties: true
      properties:
        input:
          $ref: '#/components/schemas/Input_DecisionInput'
        model:
          type: string
        questions:
          items:
            $ref: '#/components/schemas/Input_DecisionQuestion'
          type: array
        safety_identifier:
          type:
            - string
            - 'null'
      required:
        - model
        - input
        - questions
      type: object
    Output_CreateDecisionResponseBody:
      additionalProperties: true
      properties:
        answers:
          items:
            $ref: '#/components/schemas/Output_DecisionAnswer'
          type: array
        model:
          type: string
        usage:
          $ref: '#/components/schemas/Output_ResponseUsage'
      required:
        - model
        - answers
        - usage
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
      required:
        - message
      type: object
    Output_ErrorEvent:
      additionalProperties: true
      properties:
        error:
          $ref: '#/components/schemas/Output_StreamError'
        request_id:
          type:
            - string
            - 'null'
      required:
        - error
      type: object
    Output_GenerateContentError:
      additionalProperties: true
      properties:
        code:
          format: int64
          type: integer
        details:
          items: true
          type:
            - array
            - 'null'
        message:
          type: string
        status:
          type:
            - string
            - 'null'
      required:
        - code
        - message
      type: object
    Input_DecisionInput:
      anyOf:
        - type: string
        - items:
            $ref: '#/components/schemas/Input_DecisionInputMessage'
          type: array
    Input_DecisionQuestion:
      oneOf:
        - additionalProperties: true
          properties:
            instructions:
              type: string
            name:
              type:
                - string
                - 'null'
            type:
              const: predicate
              type: string
          required:
            - type
            - instructions
          type: object
        - additionalProperties: true
          properties:
            choices:
              items:
                $ref: '#/components/schemas/Input_DecisionChoice'
              type: array
            instructions:
              type: string
            name:
              type:
                - string
                - 'null'
            type:
              const: choice
              type: string
          required:
            - type
            - instructions
            - choices
          type: object
        - additionalProperties: true
          properties:
            instructions:
              type: string
            levels:
              items:
                $ref: '#/components/schemas/Input_DecisionScoreLevel'
              type: array
            name:
              type:
                - string
                - 'null'
            type:
              const: score
              type: string
          required:
            - type
            - instructions
            - levels
          type: object
    Output_DecisionAnswer:
      oneOf:
        - additionalProperties: true
          properties:
            name:
              type:
                - string
                - 'null'
            probability:
              format: double
              type: number
            type:
              const: predicate
              type: string
          required:
            - type
            - probability
          type: object
        - additionalProperties: true
          properties:
            choice:
              $ref: '#/components/schemas/Output_DecisionChoiceValue'
            confidence:
              format: double
              type: number
            name:
              type:
                - string
                - 'null'
            probabilities:
              items:
                $ref: '#/components/schemas/Output_DecisionChoiceProbability'
              type: array
            type:
              const: choice
              type: string
          required:
            - type
            - choice
            - confidence
            - probabilities
          type: object
        - additionalProperties: true
          properties:
            confidence:
              format: double
              type: number
            name:
              type:
                - string
                - 'null'
            probabilities:
              items:
                $ref: '#/components/schemas/Output_DecisionScoreProbability'
              type: array
            score:
              format: double
              type: number
            type:
              const: score
              type: string
          required:
            - type
            - score
            - confidence
            - probabilities
          type: object
        - additionalProperties: true
          properties:
            name:
              type:
                - string
                - 'null'
            type:
              const: refusal
              type: string
          required:
            - type
          type: object
    Output_ResponseUsage:
      additionalProperties: true
      properties:
        input_tokens:
          format: int64
          type: integer
        input_tokens_details:
          $ref: '#/components/schemas/Output_ResponseInputTokensDetails'
        output_tokens:
          format: int64
          type: integer
        output_tokens_details:
          $ref: '#/components/schemas/Output_ResponseOutputTokensDetails'
        total_tokens:
          format: int64
          type: integer
      required:
        - input_tokens
        - input_tokens_details
        - output_tokens
        - output_tokens_details
        - total_tokens
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Output_StreamError:
      additionalProperties: true
      properties:
        message:
          type: string
        type:
          $ref: '#/components/schemas/Output_StreamErrorType'
      required:
        - type
        - message
      type: object
    Input_DecisionInputMessage:
      additionalProperties: true
      properties:
        content:
          $ref: '#/components/schemas/Input_DecisionContent'
        role:
          $ref: '#/components/schemas/Input_DecisionRole'
        type:
          anyOf:
            - $ref: '#/components/schemas/Input_DecisionMessageType'
            - type: 'null'
      required:
        - role
        - content
      type: object
    Input_DecisionChoice:
      additionalProperties: true
      properties:
        description:
          type:
            - string
            - 'null'
        value:
          $ref: '#/components/schemas/Input_DecisionChoiceValue'
      required:
        - value
      type: object
    Input_DecisionScoreLevel:
      additionalProperties: true
      properties:
        description:
          type:
            - string
            - 'null'
        label:
          type: string
      required:
        - label
      type: object
    Output_DecisionChoiceValue:
      anyOf:
        - type: string
        - type: boolean
    Output_DecisionChoiceProbability:
      additionalProperties: true
      properties:
        probability:
          format: double
          type: number
        value:
          $ref: '#/components/schemas/Output_DecisionChoiceValue'
      required:
        - value
        - probability
      type: object
    Output_DecisionScoreProbability:
      additionalProperties: true
      properties:
        label:
          type: string
        probability:
          format: double
          type: number
        value:
          format: int64
          type: integer
      required:
        - label
        - value
        - probability
      type: object
    Output_ResponseInputTokensDetails:
      additionalProperties: true
      properties:
        cache_write_tokens:
          format: int64
          type: integer
        cache_write_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/Output_CacheWriteTokensDetails'
            - type: 'null'
        cached_tokens:
          format: int64
          type: integer
      required:
        - cache_write_tokens
        - cached_tokens
      type: object
    Output_ResponseOutputTokensDetails:
      additionalProperties: true
      properties:
        reasoning_tokens:
          format: int64
          type: integer
      required:
        - reasoning_tokens
      type: object
    Output_StreamErrorType:
      enum:
        - api_error
        - authentication_error
        - billing_error
        - invalid_request_error
        - not_found_error
        - overloaded_error
        - permission_error
        - rate_limit_error
        - timeout_error
        - conflict_error
        - request_too_large
      type: string
    Input_DecisionContent:
      anyOf:
        - type: string
        - items:
            $ref: '#/components/schemas/Input_DecisionInputPart'
          type: array
    Input_DecisionRole:
      enum:
        - user
      type: string
    Input_DecisionMessageType:
      enum:
        - message
      type: string
    Input_DecisionChoiceValue:
      anyOf:
        - type: string
        - type: boolean
    Output_CacheWriteTokensDetails:
      additionalProperties: true
      description: >-
        Non-overlapping write counts by lifetime; their sum is
        `cache_write_tokens`.
      properties:
        ttl_12h_tokens:
          format: int64
          type: integer
        ttl_30m_tokens:
          format: int64
          type: integer
      required:
        - ttl_30m_tokens
        - ttl_12h_tokens
      type: object
    Input_DecisionInputPart:
      oneOf:
        - additionalProperties: true
          properties:
            text:
              type: string
            type:
              const: input_text
              type: string
          required:
            - type
            - text
          type: object
        - additionalProperties: true
          properties:
            detail:
              anyOf:
                - $ref: '#/components/schemas/Input_DecisionImageDetail'
                - type: 'null'
            image_url:
              type: string
            type:
              const: input_image
              type: string
          required:
            - type
            - image_url
          type: object
    Input_DecisionImageDetail:
      enum:
        - low
        - high
        - auto
        - original
      type: string
  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

````

## Related topics

- [Routing & Endpoints](https://gproxy.leenhawk.com/reference/routing-table.md)
- [POST /v1/oauth/authorize](https://gproxy.leenhawk.com/api-reference/oauth/post-v1oauthauthorize.md)
- [POST /v1/live/sessions](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1livesessions.md)
- [POST /v1/conversations](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1conversations.md)
- [POST /v1/embeddings](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1embeddings.md)


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