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

# Create prompts test

> Requires scopes: runs:write



## OpenAPI

````yaml /api-reference/openapi.json post /api/prompts/{promptId}/test
openapi: 3.1.0
info:
  title: EvalGate API
  version: 3.7.6
  description: EvalGate API. See docs/api-contract.md for stability commitments.
servers:
  - url: https://evalgate.com
    description: Production
  - url: http://localhost:3000
    description: Local
security: []
paths:
  /api/prompts/{promptId}/test:
    post:
      tags:
        - prompts
      summary: Create prompts test
      description: 'Requires scopes: runs:write'
      operationId: post_prompts_promptId_test
      parameters:
        - name: promptId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostApiPromptsPromptIdTestRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiPromptsPromptIdTestResponse200ApplicationJson
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth:
            - runs:write
components:
  schemas:
    PostApiPromptsPromptIdTestRequest:
      type: object
      properties:
        input:
          type: object
          additionalProperties:
            oneOf:
              - type: 'null'
              - type: string
              - type: number
              - type: boolean
                enum:
                  - false
              - type: boolean
                enum:
                  - true
              - type: array
                items:
                  $ref: '#/components/schemas/JsonValue'
              - type: object
                additionalProperties:
                  $ref: '#/components/schemas/JsonValue'
        versionId:
          type: number
      additionalProperties: false
      required:
        - input
        - versionId
    PostApiPromptsPromptIdTestResponse200ApplicationJson:
      type: object
      properties:
        testRun:
          type: object
          properties:
            status:
              oneOf:
                - type: string
                  enum:
                    - failed
                - type: string
                  enum:
                    - success
                - type: string
                  enum:
                    - cancelled
                - type: string
                  enum:
                    - blocked
                - type: string
                  enum:
                    - timeout
                - type: string
                  enum:
                    - fallback
            modelCallId:
              type: string
            ledgerUrl:
              type: string
            content:
              type: string
            model:
              oneOf:
                - type: 'null'
                - type: string
            provider:
              oneOf:
                - type: 'null'
                - type: string
            usage:
              type: object
              properties:
                inputTokens:
                  type: number
                outputTokens:
                  type: number
                totalTokens:
                  type: number
                cachedInputTokens:
                  type: number
              additionalProperties: false
              required:
                - inputTokens
                - outputTokens
                - totalTokens
            latencyMs:
              type: number
            cost:
              type: object
              properties:
                amountUsd:
                  oneOf:
                    - type: 'null'
                    - type: string
                source:
                  oneOf:
                    - type: string
                      enum:
                        - unavailable
                    - type: string
                      enum:
                        - estimated
                    - type: string
                      enum:
                        - gateway_reported
                    - type: string
                      enum:
                        - evalgate_computed
                    - type: string
                      enum:
                        - unknown_model
                known:
                  type: boolean
              additionalProperties: false
              required:
                - amountUsd
                - source
                - known
            policyDecision:
              oneOf:
                - type: string
                  enum:
                    - denied
                - type: string
                  enum:
                    - allowed
                - type: string
                  enum:
                    - warned
          additionalProperties: false
          required:
            - status
            - modelCallId
            - ledgerUrl
            - content
            - model
            - provider
            - usage
            - latencyMs
            - cost
            - policyDecision
        prompt:
          type: object
          properties:
            artifactId:
              type: number
            key:
              type: string
            versionId:
              type: number
            versionNumber:
              type: number
            contentHash:
              type: string
            resolvedMessages:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  role:
                    oneOf:
                      - type: string
                        enum:
                          - user
                      - type: string
                        enum:
                          - system
                      - type: string
                        enum:
                          - developer
                      - type: string
                        enum:
                          - tool
                      - type: string
                        enum:
                          - assistant
                      - type: string
                        enum:
                          - example
                  content:
                    type: string
                  name:
                    type: string
                  toolCallId:
                    type: string
                additionalProperties: false
                required:
                  - id
                  - role
                  - content
          additionalProperties: false
          required:
            - artifactId
            - key
            - versionId
            - versionNumber
            - contentHash
            - resolvedMessages
      additionalProperties: false
      required:
        - testRun
        - prompt
    JsonValue:
      oneOf:
        - type: 'null'
        - type: boolean
        - type: number
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - FORBIDDEN
                - NOT_FOUND
                - VALIDATION_ERROR
                - RATE_LIMITED
                - CONFLICT
                - INTERNAL_ERROR
                - SERVICE_UNAVAILABLE
                - QUOTA_EXCEEDED
                - NO_ORG_MEMBERSHIP
                - CROSS_ORG_REFERENCE
                - INCOMPLETE
                - MALFORMED
            message:
              type: string
            details: {}
            requestId:
              type: string
              format: uuid
          required:
            - code
            - message
      required:
        - error
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or Session Token

````