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

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Refine test description

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Turns a rough description into a test name and a goal the testing agent can follow. Nothing is saved. Pass the result to [Create test](/api-reference/create-test) to add it.

This makes an AI call and usually answers within a few seconds. It's billed by the length of `description`, so it usually costs a fraction of a credit. The call is refused when the workspace is out of credits.

This is limited to 20 requests per minute per caller for each app. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. Read-only keys and workspace API keys are refused.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/testing-agent/refine
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/testing-agent/refine:
    post:
      summary: Refine test description
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Turns a rough description into a test name and a goal the testing agent
        can follow. Nothing is saved. Pass the result to [Create
        test](/api-reference/create-test) to add it.


        This makes an AI call and usually answers within a few seconds. It's
        billed by the length of `description`, so it usually costs a fraction of
        a credit. The call is refused when the workspace is out of credits.


        This is limited to 20 requests per minute per caller for each app. Some
        workspaces have a different limit.


        <Note>This endpoint accepts a personal API key belonging to a user with
        editor access to the app. Read-only keys and workspace API keys are
        refused.</Note>
      operationId: refine_flow_api_apps__app_id__testing_agent_refine_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app.
            title: App Id
          description: ID of the app.
          example: 6820f3a4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefineFlowRequest'
      responses:
        '200':
          description: The suggested name and goal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefinedTestDescription'
        '400':
          description: The workspace is out of credits.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have editor access to this app, the app is blocked, or
            your API key is read-only or a workspace API key.
        '404':
          description: App not found.
        '409':
          description: Your workspace requires an unlocked SSO session.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded.
components:
  schemas:
    RefineFlowRequest:
      properties:
        description:
          type: string
          maxLength: 500
          minLength: 1
          title: Description
          description: Rough description of what to test, in your own words.
          example: check that new projects show up on the dashboard
      type: object
      required:
        - description
      title: RefineFlowRequest
    RefinedTestDescription:
      properties:
        name:
          type: string
          title: Name
          description: Short name for the test.
          example: Create a project
        goal:
          type: string
          title: Goal
          description: The goal, rewritten as steps the testing agent can follow.
          example: >-
            Sign up, create a project called Launch, and check that it appears
            on the dashboard.
      type: object
      required:
        - name
        - goal
      title: RefinedTestDescription
      description: A test name and goal written from a rough description.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````

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