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

# Create Prompt

> Create a new prompt in a project.



## OpenAPI

````yaml POST /prompts
openapi: 3.1.1
info:
  title: Adaline API
  version: 2.0.0
  description: >-
    Public API for managing Adaline projects, prompts, datasets, evaluators,
    evaluations, providers, models, and deployments.


    Generated from Zod schemas — this spec is the single source of truth.
servers:
  - url: https://api.adaline.ai/v2
    description: Production API
security: []
tags:
  - name: datasets
    description: Manage prompt datasets and their columns and rows.
  - name: projects
    description: List and manage Adaline projects.
  - name: providers
    description: List configured LLM providers and their settings.
  - name: models
    description: List available models across providers.
  - name: prompts
    description: Create and manage prompts and their drafts.
  - name: evaluators
    description: Configure evaluators attached to a prompt.
  - name: evaluations
    description: Run and inspect evaluation results.
  - name: deployments
    description: Retrieve deployed prompt snapshots.
  - name: logs
    description: Ingest execution traces and spans for observability.
paths:
  /prompts:
    post:
      tags:
        - prompts
      summary: Create a prompt
      description: Create a new prompt in a project.
      operationId: createPrompt
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  $ref: '#/components/schemas/BaseEntityId'
                title:
                  $ref: '#/components/schemas/BaseEntityTitle'
                icon:
                  $ref: '#/components/schemas/BaseEntityIcon'
                draft:
                  type: object
                  properties:
                    config:
                      $ref: '#/components/schemas/PromptConfig'
                    messages:
                      type: array
                      description: Array of prompt messages.
                      items:
                        $ref: '#/components/schemas/PromptMessage'
                    tools:
                      type: array
                      description: Array of tool definitions available to the model.
                      items:
                        $ref: '#/components/schemas/PromptTool'
              required:
                - projectId
      responses:
        '201':
          description: Prompt created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
          headers:
            X-Request-Id:
              description: >-
                Unique identifier for the request. Returned in every response.
                Send a custom value to correlate requests, or omit to receive a
                generated UUID.
              schema:
                type: string
                format: uuid
        '400':
          description: Bad request — validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — API key lacks access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    BaseEntityId:
      title: Base Entity ID
      type: string
      description: Unique identifier for an entity, between 20 and 80 characters.
      minLength: 20
      maxLength: 80
    BaseEntityTitle:
      title: Base Entity Title
      type: string
      description: Display title for an entity, up to 50 characters.
      minLength: 1
      maxLength: 50
    BaseEntityIcon:
      title: Base Entity Icon
      type: object
      description: >-
        Icon for an entity, either an emoji or an image URL. Discriminated by
        `type`.
      properties:
        type:
          type: string
          enum:
            - emoji
            - image
        value:
          type: string
      required:
        - type
        - value
      additionalProperties: false
    PromptConfig:
      title: Prompt Config
      type: object
      description: Provider and model configuration for a prompt.
      properties:
        provider:
          type: string
          description: Provider identifier (resolved from provider ID or name).
        model:
          type: string
          description: Model identifier (e.g., `gpt-4o`, `claude-3-opus`).
        settings:
          type: object
          description: Model-specific settings (temperature, max_tokens, top_p, etc.).
          additionalProperties: true
    PromptMessage:
      type: object
      title: Prompt Message
      description: Prompt message with role and content.
      required:
        - role
        - content
      properties:
        role:
          $ref: '#/components/schemas/MessageRole'
        content:
          type: array
          items:
            $ref: '#/components/schemas/MessageContent'
    PromptTool:
      title: Prompt Tool
      description: >-
        Union type for different tool types available to LLM (currently
        functions)
      oneOf:
        - $ref: '#/components/schemas/ToolFunction'
          title: Function
      discriminator:
        propertyName: type
        mapping:
          function:
            $ref: '#/components/schemas/ToolFunction'
    Prompt:
      title: Prompt
      type: object
      description: A complete prompt with draft, playground, and published versions.
      properties:
        id:
          $ref: '#/components/schemas/BaseEntityId'
        title:
          $ref: '#/components/schemas/BaseEntityTitle'
        icon:
          $ref: '#/components/schemas/BaseEntityIcon'
        projectId:
          $ref: '#/components/schemas/BaseEntityId'
        createdAt:
          $ref: '#/components/schemas/UnixTimestamp'
        updatedAt:
          $ref: '#/components/schemas/UnixTimestamp'
        defaultPlaygroundId:
          $ref: '#/components/schemas/BaseEntityId'
        draft:
          $ref: '#/components/schemas/PromptDraft'
        contentLinks:
          type: object
          description: Map of content links (base64 content -> signed URL).
          additionalProperties:
            type: string
        defaultPlayground:
          $ref: '#/components/schemas/PromptPlayground'
      required:
        - id
        - title
        - icon
        - projectId
        - createdAt
        - updatedAt
        - defaultPlaygroundId
        - draft
        - contentLinks
    ErrorResponse:
      title: Error Response
      type: object
      description: >-
        Standard error response envelope. Permits backend-specific sibling
        fields (e.g. Zod issue details) alongside the typed `error`.
      properties:
        error:
          description: >-
            Error details — typed envelope, or a raw string reason when the
            backend's validator produces a short summary (e.g. Zod validation
            fallback).
          oneOf:
            - type: string
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable error code.
                  enum:
                    - VALIDATION_ERROR
                    - INVALID_CURSOR
                    - AUTHENTICATION_REQUIRED
                    - FORBIDDEN
                    - RESOURCE_NOT_FOUND
                    - CONFLICT
                    - PAYLOAD_TOO_LARGE
                    - RATE_LIMITED
                    - INTERNAL_ERROR
                message:
                  type: string
                  description: Human-readable error message.
                details:
                  type: array
                  description: Optional field-level validation details.
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      issue:
                        type: string
                    required:
                      - field
                      - issue
              required:
                - code
                - message
              additionalProperties: true
      required:
        - error
      additionalProperties: true
    MessageRole:
      title: Message Role
      type: string
      enum:
        - system
        - user
        - assistant
        - tool
      description: The role of a message in a prompt conversation.
    MessageContent:
      title: Message Content
      description: Message content type for prompt messages, discriminated by `modality`.
      oneOf:
        - $ref: '#/components/schemas/TextContent'
          title: Text
        - $ref: '#/components/schemas/ImageContent'
          title: Image
        - $ref: '#/components/schemas/PdfContent'
          title: PDF
        - $ref: '#/components/schemas/ToolCallContent'
          title: Tool Call
        - $ref: '#/components/schemas/ToolResponseContent'
          title: Tool Response
        - $ref: '#/components/schemas/ReasoningContent'
          title: Reasoning
        - $ref: '#/components/schemas/ErrorContent'
          title: Error
        - $ref: '#/components/schemas/SearchResultContent'
          title: Search Result
      discriminator:
        propertyName: modality
        mapping:
          text:
            $ref: '#/components/schemas/TextContent'
          image:
            $ref: '#/components/schemas/ImageContent'
          pdf:
            $ref: '#/components/schemas/PdfContent'
          tool-call:
            $ref: '#/components/schemas/ToolCallContent'
          tool-response:
            $ref: '#/components/schemas/ToolResponseContent'
          reasoning:
            $ref: '#/components/schemas/ReasoningContent'
          error:
            $ref: '#/components/schemas/ErrorContent'
          search-result:
            $ref: '#/components/schemas/SearchResultContent'
    ToolFunction:
      type: object
      title: Tool Function
      description: >-
        Tool function definition for LLM with schema and optional HTTP request
        configuration.
      required:
        - type
        - definition
      properties:
        type:
          type: string
          enum:
            - function
        definition:
          type: object
          required:
            - schema
          properties:
            schema:
              $ref: '#/components/schemas/FunctionSchema'
        request:
          anyOf:
            - $ref: '#/components/schemas/FunctionRequest'
            - type: 'null'
    UnixTimestamp:
      title: Unix Timestamp
      type: integer
      format: int64
      description: Unix timestamp in milliseconds.
      minimum: 1672511400000
      maximum: 33229420200000
    PromptDraft:
      title: Prompt Draft
      type: object
      description: A draft version of a prompt with config, messages, tools, and variables.
      properties:
        config:
          $ref: '#/components/schemas/PromptConfig'
        messages:
          type: array
          description: Array of prompt messages.
          items:
            $ref: '#/components/schemas/PromptMessage'
        tools:
          type: array
          description: Array of tool definitions available to the model.
          items:
            $ref: '#/components/schemas/PromptTool'
        variables:
          type: object
          description: Map of variable names to their definitions.
          additionalProperties:
            $ref: '#/components/schemas/PromptVariable'
      required:
        - config
        - messages
        - tools
        - variables
    PromptPlayground:
      title: Prompt Playground
      type: object
      description: A prompt playground configuration with model settings and messages.
      properties:
        id:
          $ref: '#/components/schemas/BaseEntityId'
        title:
          $ref: '#/components/schemas/BaseEntityTitle'
        messages:
          type: array
          description: Array of prompt messages.
          items:
            $ref: '#/components/schemas/PromptMessage'
        variables:
          type: object
          description: >-
            Map of variable names to their values (VariableValue objects keyed
            by variable name).
          additionalProperties:
            $ref: '#/components/schemas/VariableValue'
      required:
        - id
        - messages
        - variables
    TextContent:
      type: object
      title: Text Content
      description: Text content type for prompt messages.
      required:
        - modality
        - value
      properties:
        modality:
          type: string
          enum:
            - text
        value:
          type: string
    ImageContent:
      type: object
      title: Image Content
      description: Image content type for prompt messages with detail level specification.
      required:
        - modality
        - detail
        - value
      properties:
        modality:
          type: string
          enum:
            - image
        detail:
          type: string
          enum:
            - low
            - medium
            - high
            - auto
        value:
          $ref: '#/components/schemas/ImageContentValue'
    PdfContent:
      type: object
      title: PDF Content
      description: PDF document content type for prompt messages with file metadata.
      required:
        - modality
        - value
        - file
      properties:
        modality:
          type: string
          enum:
            - pdf
        value:
          $ref: '#/components/schemas/PdfContentValue'
        file:
          type: object
          required:
            - name
            - id
          properties:
            name:
              type: string
            id:
              type: string
            size:
              type:
                - number
                - 'null'
    ToolCallContent:
      type: object
      title: Tool Call Content
      description: Tool/function call request from LLM with arguments and metadata.
      required:
        - modality
        - index
        - id
        - name
        - arguments
      properties:
        modality:
          type: string
          enum:
            - tool-call
        index:
          type: integer
          minimum: 0
        id:
          type: string
          minLength: 1
        name:
          type: string
          minLength: 1
        arguments:
          type: string
        serverName:
          type:
            - string
            - 'null'
    ToolResponseContent:
      type: object
      title: Tool Response Content
      description: >-
        Tool/function execution response returned to LLM with result data and
        optional API metadata.
      required:
        - modality
        - index
        - id
        - name
        - data
      properties:
        modality:
          type: string
          enum:
            - tool-response
        index:
          type: integer
          minimum: 0
        id:
          type: string
          minLength: 1
        name:
          type: string
          minLength: 1
        data:
          type: string
        apiResponse:
          type:
            - object
            - 'null'
          properties:
            statusCode:
              type: integer
              minimum: 0
    ReasoningContent:
      type: object
      title: Reasoning Content
      description: >-
        Reasoning content type for LLM chain-of-thought and extended thinking
        responses.
      required:
        - modality
        - value
      properties:
        modality:
          type: string
          enum:
            - reasoning
        value:
          $ref: '#/components/schemas/ReasoningContentValueUnion'
    ErrorContent:
      type: object
      title: Error Content
      description: Error content type for LLM safety and content filtering errors.
      required:
        - modality
        - value
      properties:
        modality:
          type: string
          enum:
            - error
        value:
          $ref: '#/components/schemas/ErrorContentValue'
    SearchResultContent:
      type: object
      title: Search Result Content
      description: >-
        Search result content type for grounding LLM responses with web search
        data.
      required:
        - modality
        - value
      properties:
        modality:
          type: string
          enum:
            - search-result
        value:
          $ref: '#/components/schemas/SearchResultContentValue'
    FunctionSchema:
      type: object
      title: Function Schema
      description: >-
        Function/tool schema definition for LLM function calling with
        parameters.
      required:
        - name
        - description
        - parameters
      properties:
        name:
          type: string
          pattern: ^[a-zA-Z0-9_]{1,64}$
          maxLength: 64
        description:
          type: string
          maxLength: 4096
        parameters:
          type: object
          additionalProperties: true
          description: Function parameters - can be any valid JSON schema
        strict:
          type:
            - boolean
            - 'null'
    FunctionRequest:
      title: Function Request
      description: >-
        Union type for different function/tool execution methods (currently
        HTTP)
      oneOf:
        - $ref: '#/components/schemas/FunctionRequestHttp'
          title: HTTP
      discriminator:
        propertyName: type
        mapping:
          http:
            $ref: '#/components/schemas/FunctionRequestHttp'
    PromptVariable:
      title: Prompt Variable
      type: object
      required:
        - modality
      description: >-
        Prompt variable definition. When this appears as the value type of a
        `variables` map, the name is the map key and is therefore omitted here;
        when it appears as an array item, the `name` field is set explicitly.
      properties:
        name:
          type: string
          description: >-
            The variable name as it appears in the prompt template. Omitted when
            the enclosing container is a map keyed by variable name.
        modality:
          $ref: '#/components/schemas/VariableModality'
    VariableValue:
      title: Variable Value
      description: >-
        Variable value type for variables within a prompt / playground,
        discriminated by `modality`.
      oneOf:
        - $ref: '#/components/schemas/TextContent'
          title: Text
        - $ref: '#/components/schemas/ImageContent'
          title: Image
        - $ref: '#/components/schemas/PdfContent'
          title: PDF
        - $ref: '#/components/schemas/ApiContent'
          title: API
        - $ref: '#/components/schemas/PromptContent'
          title: Prompt
      discriminator:
        propertyName: modality
        mapping:
          text:
            $ref: '#/components/schemas/TextContent'
          image:
            $ref: '#/components/schemas/ImageContent'
          pdf:
            $ref: '#/components/schemas/PdfContent'
          api:
            $ref: '#/components/schemas/ApiContent'
          prompt:
            $ref: '#/components/schemas/PromptContent'
    ImageContentValue:
      title: Image Content Value
      description: Union type for image content - either base64 encoded or URL reference.
      oneOf:
        - $ref: '#/components/schemas/Base64ImageContentValue'
          title: Base64
        - $ref: '#/components/schemas/UrlImageContentValue'
          title: URL
        - $ref: '#/components/schemas/Base64HostedImageContentValue'
          title: Base64 Hosted
      discriminator:
        propertyName: type
        mapping:
          base64:
            $ref: '#/components/schemas/Base64ImageContentValue'
          url:
            $ref: '#/components/schemas/UrlImageContentValue'
          base64-hosted:
            $ref: '#/components/schemas/Base64HostedImageContentValue'
    PdfContentValue:
      title: PDF Content Value
      description: Union type for PDF content - either base64 encoded or URL reference.
      oneOf:
        - $ref: '#/components/schemas/Base64PdfContentValue'
          title: Base64
        - $ref: '#/components/schemas/UrlPdfContentValue'
          title: URL
        - $ref: '#/components/schemas/Base64HostedPdfContentValue'
          title: Base64 Hosted
      discriminator:
        propertyName: type
        mapping:
          base64:
            $ref: '#/components/schemas/Base64PdfContentValue'
          url:
            $ref: '#/components/schemas/UrlPdfContentValue'
          base64-hosted:
            $ref: '#/components/schemas/Base64HostedPdfContentValue'
    ReasoningContentValueUnion:
      title: Reasoning Content Value Union
      description: >-
        Union type for reasoning content - either full thinking or redacted
        version.
      oneOf:
        - $ref: '#/components/schemas/ReasoningContentValue'
          title: Thinking
        - $ref: '#/components/schemas/RedactedReasoningContentValue'
          title: Redacted
      discriminator:
        propertyName: type
        mapping:
          thinking:
            $ref: '#/components/schemas/ReasoningContentValue'
          redacted:
            $ref: '#/components/schemas/RedactedReasoningContentValue'
    ErrorContentValue:
      title: Error Content Value
      description: Union type for error content values.
      oneOf:
        - $ref: '#/components/schemas/SafetyErrorContentValue'
          title: Safety Error
      discriminator:
        propertyName: type
        mapping:
          safety:
            $ref: '#/components/schemas/SafetyErrorContentValue'
    SearchResultContentValue:
      title: Search Result Content Value
      description: Union type for search result content values.
      oneOf:
        - $ref: '#/components/schemas/SearchResultGoogleContentValue'
          title: Google
      discriminator:
        propertyName: type
        mapping:
          google:
            $ref: '#/components/schemas/SearchResultGoogleContentValue'
    FunctionRequestHttp:
      type: object
      title: Function Request HTTP
      description: >-
        HTTP request configuration for executing function/tool calls via REST
        API.
      required:
        - type
        - method
        - url
      properties:
        type:
          type: string
          enum:
            - http
        method:
          type: string
          enum:
            - get
            - post
        url:
          type: string
          format: uri
        headers:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        query:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        body:
          type:
            - object
            - 'null'
          additionalProperties: true
        proxyUrl:
          type:
            - string
            - 'null'
          format: uri
        proxyHeaders:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        retry:
          anyOf:
            - $ref: '#/components/schemas/FunctionRequestRetry'
            - type: 'null'
    VariableModality:
      title: Variable Modality
      type: string
      enum:
        - text
        - image
        - pdf
        - api
        - prompt
      description: Variable modality type.
    ApiContent:
      type: object
      title: API Content
      description: API call content type for making HTTP requests within prompt messages.
      required:
        - modality
        - url
        - method
      properties:
        modality:
          type: string
          enum:
            - api
        url:
          type: string
        method:
          $ref: '#/components/schemas/ApiHttpMethod'
        headers:
          type: object
          additionalProperties:
            type: string
        params:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
        secretHeaders:
          type: array
          items:
            type: string
          description: Array of header keys that should be obfuscated
    PromptContent:
      type: object
      title: Prompt Content
      description: >-
        Prompt variable reference content type for embedding prompts within
        messages.
      required:
        - modality
        - promptId
      properties:
        modality:
          type: string
          enum:
            - prompt
        promptId:
          type: string
    Base64ImageContentValue:
      type: object
      title: Base64 Image Content Value
      description: Base64-encoded image data with media type specification.
      required:
        - type
        - base64
        - mediaType
      properties:
        type:
          type: string
          enum:
            - base64
        base64:
          type: string
        mediaType:
          type: string
          enum:
            - png
            - jpeg
            - webp
            - gif
    UrlImageContentValue:
      type: object
      title: URL Image Content Value
      description: URL reference to an externally hosted image.
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - url
        url:
          type: string
    Base64HostedImageContentValue:
      type: object
      title: Base64 Hosted Image Content Value
      description: >-
        Base64-encoded image data with path and base64 hash, reference to a
        base64 image hosted on the platform.
      required:
        - type
        - path
        - base64Hash
      properties:
        type:
          type: string
          enum:
            - base64-hosted
        path:
          type: string
          minLength: 1
        base64Hash:
          type: string
          minLength: 1
    Base64PdfContentValue:
      type: object
      title: Base64 PDF Content Value
      description: Base64-encoded PDF document data.
      required:
        - type
        - base64
      properties:
        type:
          type: string
          enum:
            - base64
        base64:
          type: string
    UrlPdfContentValue:
      type: object
      title: URL PDF Content Value
      description: URL reference to an externally hosted PDF document.
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - url
        url:
          type: string
    Base64HostedPdfContentValue:
      type: object
      title: Base64 Hosted PDF Content Value
      description: >-
        Base64-encoded PDF document data with path and preview, reference to a
        base64 PDF hosted on the platform.
      required:
        - type
        - path
        - preview
      properties:
        type:
          type: string
          enum:
            - base64-hosted
        path:
          type: string
          minLength: 1
        preview:
          type: string
          minLength: 1
    ReasoningContentValue:
      type: object
      title: Reasoning Content Value
      description: >-
        LLM reasoning/thinking content with cryptographic signature for
        verification.
      required:
        - type
        - thinking
        - signature
      properties:
        type:
          type: string
          enum:
            - thinking
        thinking:
          type: string
        signature:
          type: string
    RedactedReasoningContentValue:
      type: object
      title: Redacted Reasoning Content Value
      description: Redacted/masked reasoning content for privacy-sensitive contexts.
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum:
            - redacted
        data:
          type: string
    SafetyErrorContentValue:
      type: object
      title: Safety Error Content Value
      description: >-
        Safety filter error with category, probability, and blocking
        information.
      required:
        - type
        - value
      properties:
        type:
          type: string
          enum:
            - safety
        value:
          type: object
          required:
            - category
            - probability
            - blocked
            - message
          properties:
            category:
              type: string
            probability:
              type: string
            blocked:
              type: boolean
            message:
              type: string
    SearchResultGoogleContentValue:
      type: object
      title: Search Result Google Content Value
      description: Google search result with query, responses, and references.
      required:
        - type
        - query
        - responses
        - references
      properties:
        type:
          type: string
          enum:
            - google
        query:
          type: string
        responses:
          type: array
          items:
            type: object
            required:
              - source
              - url
              - title
            properties:
              source:
                type: string
              url:
                type: string
              title:
                type: string
              snippet:
                type: string
        references:
          type: array
          items:
            type: object
            required:
              - text
              - responseIndices
            properties:
              text:
                type: string
              responseIndices:
                type: array
                items:
                  type: number
              startIndex:
                type: number
              endIndex:
                type: number
              confidenceScores:
                type: array
                items:
                  type: number
    FunctionRequestRetry:
      type: object
      title: Function Request Retry
      description: >-
        Retry configuration for function/tool execution with exponential backoff
        settings.
      required:
        - maxAttempts
        - initialDelay
        - exponentialFactor
      properties:
        maxAttempts:
          type: integer
          minimum: 1
        initialDelay:
          type: integer
          minimum: 1
        exponentialFactor:
          type: integer
          minimum: 1
    ApiHttpMethod:
      title: HTTP Method
      type: string
      enum:
        - GET
        - POST
        - PUT
        - PATCH
        - DELETE
      description: Standard HTTP request method.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Workspace API key. Pass as `Authorization: Bearer <key>`.'

````