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

# Create agent

> Create an agent to test inside Calibrate or connect your existing agent to Calibrate



## OpenAPI

````yaml /api-reference/openapi.json post /agents
openapi: 3.1.0
info:
  title: Calibrate Public API
  version: 0.1.0
  description: Programmatic API for CI/automation. Pass your key in the `X-API-Key` header.
servers:
  - url: https://api.calibrate.artpark.ai
    description: Production
security: []
paths:
  /agents:
    post:
      tags:
        - agents
      summary: Create agent
      description: >-
        Create an agent to test inside Calibrate or connect your existing agent
        to Calibrate
      operationId: create_agent_endpoint_agents_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCreate'
            examples:
              agent_within_calibrate:
                summary: Agent within Calibrate
                description: >-
                  Build a voice/chat agent inside Calibrate. This config is the
                  managed defaults spelled out. Override only the keys you want
                  to change; omitted keys still inherit the defaults.
                value:
                  name: Support Agent
                  type: agent
                  config:
                    system_prompt: You are a helpful assistant.
                    llm:
                      model: google/gemini-2.5-flash
                    stt:
                      provider: google
                    tts:
                      provider: google
                    settings:
                      agent_speaks_first: false
                      max_assistant_turns: 10
              openai_compatible_connection:
                summary: Connect OpenAI-compatible agent
                description: >-
                  Connect your own agent over an OpenAI-compatible HTTP
                  endpoint. `config.agent_url` is required; `agent_headers`
                  carries the auth token the endpoint expects.
                value:
                  name: My Hosted Agent
                  type: connection
                  config:
                    agent_url: https://api.example.com/v1/chat/completions
                    agent_headers:
                      Authorization: Bearer <token>
                    benchmark_provider: openrouter
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: Agent within Calibrate
          source: |-
            curl --request POST \
              --url https://api.calibrate.artpark.ai/agents \
              --header 'Content-Type: application/json' \
              --header 'X-API-Key: <api-key>' \
              --data '{
              "name": "Support Agent",
              "type": "agent",
              "config": {
                "system_prompt": "You are a helpful assistant.",
                "llm": {
                  "model": "google/gemini-2.5-flash"
                },
                "stt": {
                  "provider": "google"
                },
                "tts": {
                  "provider": "google"
                },
                "settings": {
                  "agent_speaks_first": false,
                  "max_assistant_turns": 10
                }
              }
            }'
        - lang: curl
          label: Connect OpenAI-compatible agent
          source: |-
            curl --request POST \
              --url https://api.calibrate.artpark.ai/agents \
              --header 'Content-Type: application/json' \
              --header 'X-API-Key: <api-key>' \
              --data '{
              "name": "My Hosted Agent",
              "type": "connection",
              "config": {
                "agent_url": "https://api.example.com/v1/chat/completions",
                "agent_headers": {
                  "Authorization": "Bearer <token>"
                },
                "benchmark_provider": "openrouter"
              }
            }'
components:
  schemas:
    AgentCreate:
      properties:
        name:
          type: string
          title: Name
          description: Agent name, unique within the workspace
        type:
          type: string
          enum:
            - agent
            - connection
          title: Type
          description: |-
            - `agent`: built inside Calibrate
            - `connection`: your existing agent connected to Calibrate
          default: agent
        config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Agent behavioral config. The keys depend on `type`.


            **`type=agent`**, built inside Calibrate:

            - `system_prompt`: the agent's instructions

            - `llm.model`: `provider/model`, e.g. `openai/gpt-4.1` or
            `google/gemini-2.5-flash`

            - `stt.provider`: `deepgram`, `openai`, `cartesia`, `elevenlabs`,
            `google`, `sarvam`, or `smallest`

            - `tts.provider`: `cartesia`, `openai`, `google`, `elevenlabs`,
            `sarvam`, or `smallest`

            - `settings.agent_speaks_first`, `settings.max_assistant_turns`

            - `system_tools.end_call`: let the agent end the call

            - `data_extraction_fields`: `[{name, type, description, required}]`


            ```json

            {
              "system_prompt": "You are a helpful support agent.",
              "llm": {"model": "openai/gpt-4.1"},
              "stt": {"provider": "deepgram"},
              "tts": {"provider": "elevenlabs"},
              "settings": {"agent_speaks_first": true, "max_assistant_turns": 50}
            }

            ```


            **`type=connection`**, your own HTTP endpoint:

            - `agent_url`: public HTTP(S) endpoint your agent is called at

            - `agent_headers`: headers sent on each request, e.g. auth

            - `benchmark_provider`: `openrouter` by default. Other values:
            `openai`, `google`, `anthropic`, `meta-llama`, `mistralai`,
            `deepseek`, `x-ai`, `cohere`, `qwen`, or `ai21`


            ```json

            {
              "agent_url": "https://api.example.com/agent",
              "agent_headers": {"Authorization": "Bearer <token>"},
              "benchmark_provider": "openrouter"
            }

            ```


            For `type=agent`, omitted keys inherit managed defaults. Omit
            `config` entirely to use all defaults. For `type=connection`,
            `config` is stored as-is and must contain `agent_url`
      type: object
      required:
        - name
      title: AgentCreate
    AgentCreateResponse:
      properties:
        uuid:
          type: string
          maxLength: 36
          minLength: 36
          title: Uuid
          description: ID of the newly created agent
          examples:
            - f47ac10b-58cc-4372-a567-0e02b2c3d479
        message:
          type: string
          title: Message
          description: Confirmation message
      type: object
      required:
        - uuid
        - message
      title: AgentCreateResponse
    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:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````