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

# Create an agent



## OpenAPI

````yaml POST /api/agents
openapi: 3.0.3
info:
  title: LiteLLM Agent Platform API
  description: >-
    Unified API for the LiteLLM Agent Platform — gateway, agents, sessions, and
    runtimes.
  version: 0.1.0
servers:
  - url: https://litellm-rust.onrender.com
    description: Production
  - url: http://localhost:4000
    description: Local (Docker Compose)
security:
  - BearerAuth: []
tags:
  - name: System
  - name: Models
  - name: Messages
  - name: API Keys
  - name: Agents
  - name: Sessions
  - name: Runtimes
  - name: MCP
paths:
  /api/agents:
    post:
      tags:
        - Agents
      summary: Create an agent
      operationId: createAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentRequest'
      responses:
        '201':
          description: Agent created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '401':
          description: Unauthorized
      security:
        - BearerAuth: []
components:
  schemas:
    CreateAgentRequest:
      type: object
      required:
        - name
        - owner_id
      properties:
        name:
          type: string
          example: my-agent
        owner_id:
          type: string
          example: local-user
        runtime:
          type: string
          example: cursor
          description: >-
            Built-in runtime ID or registered runtime harness alias. Stored in
            agent config.
        model:
          type: string
          example: claude-opus-4-5
        system:
          type: string
          example: You are a helpful assistant.
        description:
          type: string
        prompt:
          type: string
          description: Fallback system prompt when `system` is omitted.
        config:
          type: object
        tools:
          description: Runtime tool definitions.
          oneOf:
            - type: array
              items:
                type: object
            - type: object
    Agent:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          example: my-agent
        model:
          type: string
          example: claude-opus-4-5
        system:
          type: string
        tools:
          type: object
        config:
          type: object
          description: >-
            Runtime-specific config. For runtime-backed agents this usually
            includes `runtime`.
        owner_id:
          type: string
          nullable: true
        status:
          type: string
          example: paused
        description:
          type: string
          nullable: true
        harness:
          type: string
          example: claude-code
        created_at:
          type: integer
          format: int64
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Your LITELLM_MASTER_KEY. Default for local Docker Compose: `sk-local`'

````