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

# Create a saved prompt

> 

<Note>To use our EU server for LLM Gateway, replace `llm-gateway.assemblyai.com` with `llm-gateway.eu.assemblyai.com`.</Note>

Stores a prompt under a name so it can be used later by passing `aai_prompt` to [Create a chat completion](https://www.assemblyai.com/docs/llm-gateway/api-reference/create-chat-completion). Names are unique per account. See [Saved prompts](https://www.assemblyai.com/docs/llm-gateway/saved-prompts) for the full guide.



## OpenAPI

````yaml api-reference/specs/llm-gateway.yaml POST /prompts
openapi: 3.1.0
info:
  title: AAI Chat Completions API
  description: API for generating text with various language models.
  version: 1.0.0
servers:
  - url: https://llm-gateway.assemblyai.com/v1
    description: Production Server
    x-fern-server-name: Production
security:
  - ApiKey: []
paths:
  /prompts:
    post:
      summary: Create a saved prompt
      description: >-


        <Note>To use our EU server for LLM Gateway, replace
        `llm-gateway.assemblyai.com` with
        `llm-gateway.eu.assemblyai.com`.</Note>


        Stores a prompt under a name so it can be used later by passing
        `aai_prompt` to [Create a chat
        completion](https://www.assemblyai.com/docs/llm-gateway/api-reference/create-chat-completion).
        Names are unique per account. See [Saved
        prompts](https://www.assemblyai.com/docs/llm-gateway/saved-prompts) for
        the full guide.
      operationId: createSavedPrompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSavedPromptRequest'
            examples:
              create_example:
                summary: Save a call summary prompt
                value:
                  name: call-summary
                  prompt: >-
                    {"model": "gemini-2.5-flash-lite", "max_tokens": 500,
                    "messages": [{"role": "system", "content": "You summarize
                    calls for {{ team }}."}, {"role": "user", "content":
                    "Summarize this call: {{ transcript }}"}]}
      responses:
        '201':
          description: The saved prompt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedPrompt'
        '400':
          description: The name or prompt is invalid. `metadata.errors` lists each problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Your account already has a prompt with this name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateSavedPromptRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
          description: >-
            A name for the prompt, unique within your account. Up to 128
            characters, starting with a letter or number and containing only
            letters, numbers, `.`, `_` and `-`.
          examples:
            - call-summary
        prompt:
          type: string
          description: >
            The prompt, as a JSON string of a chat completions request body.
            It's validated the way a chat completions request is, and can be up
            to 50 KiB. Use `{{ tag }}` placeholders in message content to fill
            in values per request with `prompt_replacements`.
      required:
        - name
        - prompt
    SavedPrompt:
      type: object
      properties:
        name:
          type: string
          description: The name of the prompt.
        prompt:
          type: string
          description: The prompt, as a JSON string of a chat completions request body.
        created_at:
          type: string
          format: date-time
          description: When the prompt was created.
        updated_at:
          type: string
          format: date-time
          description: When the prompt was last updated.
      required:
        - name
        - prompt
        - created_at
        - updated_at
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code for the error.
        message:
          type: string
          description: A human-readable description of the error.
        request_id:
          type: string
          format: uuid
          description: Unique identifier for the request.
        metadata:
          type: object
          description: >-
            Optional. Present on 400 responses with per-field validation
            details.
          properties:
            errors:
              type: array
              items:
                type: string
              description: List of specific validation failure messages.
      required:
        - code
        - message
        - request_id
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

````