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

# Generate tap script (AI)

> Uses AI to generate a Python `fetch()` script from a plain-English description. The system prompt branches on `tapType` — document taps get a prompt that instructs the LLM to return `{uri, filename, content}` dicts, never chunk or embed, and never fall back to scanning the local filesystem.



## OpenAPI

````yaml /openapi.yaml post /api/v1/tap/generate
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.0.0
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/tap/generate:
    post:
      tags:
        - Taps
      summary: Generate tap script (AI)
      description: >-
        Uses AI to generate a Python `fetch()` script from a plain-English
        description. The system prompt branches on `tapType` — document taps get
        a prompt that instructs the LLM to return `{uri, filename, content}`
        dicts, never chunk or embed, and never fall back to scanning the local
        filesystem.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - description
                - tapName
              properties:
                description:
                  type: string
                tapName:
                  type: string
                oldScriptPath:
                  type: string
                  description: >-
                    Path of a previous script to delete after the new one is
                    written
                secretName:
                  type: string
                  description: >-
                    Tap secret name — env var keys are passed to the AI as
                    context
                tapType:
                  type: string
                  enum:
                    - structured
                    - document
                  default: structured
                  description: Selects the system prompt for the generated script.
      responses:
        '200':
          description: Generated script
          content:
            application/json:
              schema:
                type: object
                properties:
                  script:
                    type: string
                  packages:
                    type: array
                    items:
                      type: string
                  scriptPath:
                    type: string
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````