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

# Invoke Agent (Sync)

> Execute an agent and wait for completion. Returns the final result.

Invoke an agent synchronously. The request blocks until the agent finishes (typically 5–30 seconds) and returns the completed task with the result.

For longer-running tasks, use [Invoke Agent (Async)](/api-reference/v1/agents/invoke-async) or [Invoke Agent (Stream)](/api-reference/v1/agents/invoke-stream).

## Path Parameters

<ParamField path="agent_id" type="string" required>
  Agent ID (UUID)
</ParamField>

## Request Body

`input.text`, `input.user.id`, and `input.user.email` are required. `user_oidc_token` is optional for MCP OAuth-backed tools.

<ParamField body="input" type="object" required>
  <Expandable title="Input Object">
    <ParamField body="text" type="string" required>
      The message or prompt to send to the agent.
    </ParamField>

    <ParamField body="user" type="object" required>
      Identity of the end user invoking the agent.

      <Expandable title="User Object">
        <ParamField body="id" type="string" required>
          External user ID from your system.
        </ParamField>

        <ParamField body="email" type="string" required>
          User email address.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="user_oidc_token" type="string">
  Optional OIDC token for MCP OAuth-authenticated tools.
</ParamField>

<ParamField body="id" type="string">
  **Thread ID for multi-turn conversations.** Pass the `id` from a previous task's response to continue the same conversation. The agent will have full context of all prior messages. If omitted, a new thread is created automatically.
</ParamField>

<ParamField body="disable_attachment_injection" type="boolean" default="false">
  When `true`, files passed in `input.files` are **not injected into the LLM context window**. The file URLs are still available to the agent's tools, but the raw content won't be prepended to the prompt.

  **Use this when:**

  * Files are large (would exceed the model's context limit)
  * You want tools to process the files rather than the LLM reading them directly
  * You're passing many files and don't need them all in context

  **Default (`false`):** file contents are downloaded, extracted, and injected directly into the LLM prompt as context.
</ParamField>

<ParamField body="think_mode" type="string" default="default">
  Controls the agent's reasoning depth. `default` for standard reasoning, `harder` for deeper chain-of-thought analysis. Use `harder` for complex multi-step tasks that benefit from more deliberate planning.
</ParamField>

<ParamField body="instructions_override" type="string">
  Additional instructions appended to the agent's system prompt **for this invocation only**. Use this to adjust behavior per-request without changing the agent's configuration — for example, restricting output format, adding constraints, or changing tone.
</ParamField>

<ParamField body="additional_context" type="string">
  Extra context appended to the agent's system prompt **for this invocation only**. Unlike `instructions_override` (which adds behavioral instructions), this supplies supplementary facts or context the agent should consider for this run — e.g. relevant background data, the current state of an external system, or a user's recent activity.
</ParamField>

<ParamField body="expected_output" type="string">
  Natural-language description of the desired output (e.g., `"A bulleted list of key findings"`). Guides the agent's response style.
</ParamField>

<ParamField body="llm_model_provider" type="string">
  **Per-execution LLM provider override.** Use the provider's internal identifier (e.g. `openai`, `anthropic`, `bedrock`) from `GET /v1/llm_providers`. Omit to use the agent's configured provider.
</ParamField>

<ParamField body="llm_model_name" type="string">
  **Per-execution model override.** Must be a valid model under the chosen provider (`GET /v1/llm_providers/{provider}/models`). Examples: `claude-sonnet-4-6`, `gpt-5`, `gemini-2.0-flash`. Omit to use the agent's configured model.
</ParamField>

<ParamField body="llm_reasoning_effort" type="string" default="medium">
  **Per-execution reasoning-effort override** for reasoning-capable models (e.g. GPT-5). One of `low`, `medium`, `high`, `xhigh`. Omit to use the agent's configured reasoning effort.
</ParamField>

## Query Parameters

<ParamField query="version" type="string">
  Agent version to invoke. Defaults to the latest deployed version. Use `"draft"` to test undeployed changes.
</ParamField>

## Response

The response is the full task object. The key fields you'll use:

<ResponseField name="id" type="string">
  Task/thread ID. Pass this back as `id` in your next request to continue the conversation.
</ResponseField>

<ResponseField name="status" type="string">
  `completed`, `failed`, `error`, or `stopped`
</ResponseField>

<ResponseField name="result" type="string">
  The agent's response. If `output_format` is `json`, this is a JSON string — parse it with `JSON.parse()` or `jq`.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when the task was created
</ResponseField>

<ResponseField name="finished_at" type="string">
  ISO 8601 timestamp when the task completed
</ResponseField>

<ResponseField name="llm_model_provider" type="string">
  Effective LLM provider used for this execution. Reflects the per-execution override when supplied, otherwise the agent's configured provider.
</ResponseField>

<ResponseField name="llm_model_name" type="string">
  Effective model name used for this execution. Reflects the per-execution override when supplied, otherwise the agent's configured model.
</ResponseField>

<ResponseField name="llm_reasoning_effort" type="string">
  Effective reasoning effort used for this execution. One of `low`, `medium`, `high`, `xhigh`. Reflects the per-execution override when supplied, otherwise the agent's configured reasoning effort.
</ResponseField>

## Simplest Possible Invoke

```bash theme={"dark"}
curl -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"input": {"text": "What is xpander.ai?"}}'
```

Extract just the result:

```bash theme={"dark"}
curl -s ... | jq -r '.result'
```

## Multi-Turn Conversation

Pass the `id` from the first response to continue the thread:

```bash theme={"dark"}
# Turn 1
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"input": {"text": "Hi, my name is David and I work at xpander.ai"}}'

# Response includes: "id": "6525177e-06a1-4063-82fe-37382d2302a5"

# Turn 2 — pass the same id
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {"text": "What is my name and where do I work?"},
    "id": "6525177e-06a1-4063-82fe-37382d2302a5"
  }'

# Agent responds: "Your name is David and you work at xpander.ai."
```

The agent remembers all previous messages in the thread. Always reuse the same `id` for follow-ups.

## With User Identity

Pass the required user fields so the agent can personalize responses and use identity-aware tools:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {
      "text": "What is my user ID and email?",
      "user": {
        "id": "user-123",
        "email": "david@xpander.ai"
      }
    }
  }'
```

```json theme={"dark"}
{
  "status": "completed",
  "result": "Your user ID is user-123 and your email is david@xpander.ai."
}
```

The `user` object is visible to the agent as context. Both `id` and `email` are required.

## With MCP OAuth

Pass `user_oidc_token` when the agent uses MCP tools that require OAuth on behalf of the user:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {
      "text": "Create a calendar event for tomorrow at 10am",
      "user": {
        "id": "user-123",
        "email": "david@xpander.ai"
      }
    },
    "user_oidc_token": "USER_OIDC_TOKEN"
  }'
```

## Processing Files

Files passed in `input.files` are downloaded and injected directly into the LLM context window by default. This works well for small-to-medium files:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {
      "text": "What is the abstract of this paper?",
      "files": ["https://assets.xpanderai.io/static/pdf/bitcoin.pdf"]
    }
  }'
```

```json theme={"dark"}
{
  "status": "completed",
  "result": "The abstract describes a peer-to-peer electronic cash system that enables direct online payments without financial institutions, solving the double-spending problem through a distributed network using proof-of-work and cryptographic signatures."
}
```

The 9-page Bitcoin whitepaper (above) processes successfully — its content fits within the model's context window.

### Large Files Fail with Direct Injection

Large files will exceed the model's context limit and return an error:

```bash theme={"dark"}
# This 185-page PDF will fail — too large for the context window
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {
      "text": "What year was the Apple Macintosh introduced?",
      "files": ["https://assets.xpanderai.io/static/pdf/Introducing_the_Apple_Macintosh_1984.pdf"]
    }
  }'
```

```json theme={"dark"}
{
  "status": "error",
  "result": "Error code: 413 - {'error': {'type': 'request_too_large', 'message': 'Request exceeds the maximum size'}}"
}
```

<Warning>
  Files are injected into the LLM context by default. Documents over \~100 pages will typically exceed the model's token limit. For large documents, use a [Knowledge Base](/api-reference/v1/knowledge/create-knowledge-base) instead — add the document to a KB, attach it to the agent, and the agent will search it automatically via RAG.
</Warning>

### Disable Context Injection

Set `disable_attachment_injection: true` to pass the file URL to the agent's tools without injecting its content into the LLM prompt:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {
      "text": "Analyze this dataset",
      "files": ["https://example.com/data.csv"]
    },
    "disable_attachment_injection": true
  }'
```

With this flag, the file URL is available to the agent's tools but the raw content is not prepended to the prompt. Use this when you want the agent's tools to process the file rather than the LLM reading it directly.

<Info>
  For very large files (185+ pages), even `disable_attachment_injection: true` may not be enough — the file can exceed the HTTP request size limit before reaching the LLM. Use a [Knowledge Base](/api-reference/v1/knowledge/create-knowledge-base) for production workflows with large documents.
</Info>

## Per-Request Instruction Override

Append instructions for this specific invocation without changing the agent's configuration:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {"text": "Tell me about xpander pricing"},
    "title": "Pricing Inquiry",
    "instructions_override": "Always respond in exactly 2 sentences. Never use emojis."
  }'
```

```json theme={"dark"}
{
  "status": "completed",
  "title": "Pricing Inquiry",
  "result": "xpander.ai offers two main pricing tiers: a Free plan with 2 serverless agents and 100 AI actions, and an In-House plan at $940/month for up to 10 agents and 200K actions. You can deploy on xpander's managed cloud or your own infrastructure."
}
```

## Per-Execution LLM Override

Override the agent's configured provider, model, or reasoning effort for a single invocation without mutating the agent. Useful for A/B testing models, routing specific requests to a stronger or cheaper model, or dialing up reasoning effort on complex prompts:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "input": {"text": "Summarize the attached research paper"},
    "llm_model_provider": "openai",
    "llm_model_name": "gpt-5",
    "llm_reasoning_effort": "high"
  }'
```

All three fields are optional and independent — supply only the ones you want to override. Omitted fields fall back to the agent's configured values.

The response object includes the **effective** `llm_model_provider`, `llm_model_name`, and `llm_reasoning_effort` that were actually used, so downstream metrics and dashboards correctly attribute the run.

## Structured JSON Output

Request structured output with a JSON Schema:

```bash theme={"dark"}
curl -s -X POST "https://api.xpander.ai/v1/agents/<agent-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"input": {"text": "Look up Stripe"}}'
```

<Info>
  To configure `output_format` and `output_schema` for structured output, use the [Update Agent](/api-reference/v1/agents/update-agent) endpoint or configure it in the dashboard under the Output tab.
</Info>

## Example Response

```json theme={"dark"}
{
  "id": "6525177e-06a1-4063-82fe-37382d2302a5",
  "agent_id": "<agent-id>",
  "organization_id": "<org-id>",
  "status": "completed",
  "input": {
    "text": "What is xpander.ai in one sentence?",
  },
  "result": "xpander.ai is a full-stack platform for building, deploying, and running autonomous AI agents in production.",
  "source": "api",
  "think_mode": "default",
  "disable_attachment_injection": false,
  "created_at": "2026-02-07T10:15:22.100233Z",
  "started_at": "2026-02-07T10:15:22.500000Z",
  "finished_at": "2026-02-07T10:15:28.997811Z",
  "execution_attempts": 1,
  "llm_model_provider": "anthropic",
  "llm_model_name": "claude-sonnet-4-6",
  "llm_reasoning_effort": "medium"
}
```

## See Also

* [Invoke Agent (Async)](/api-reference/v1/agents/invoke-async) — returns immediately with a task ID for polling
* [Invoke Agent (Stream)](/api-reference/v1/agents/invoke-stream) — real-time SSE stream of agent activity
* [Get Thread](/api-reference/v1/tasks/get-thread) — retrieve the full conversation history
* [Webhook documentation](/webhooks) — trigger agents from external systems via the auto-generated `webhook_url`


## OpenAPI

````yaml POST /v1/agents/{agent_id}/invoke
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/agents/{agent_id}/invoke:
    post:
      tags:
        - API v1
        - Agents
        - Agents Invocation
      summary: Invoke Agent (Sync)
      description: >-
        Invoke an AI agent and wait for task completion. Returns the final
        result.
      operationId: Invoke_Agent__Sync__v1_agents__agent_id__invoke_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: version
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The agent/workflow version to invoke. default = latest
            title: Version
          description: The agent/workflow version to invoke. default = latest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentExecutionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedTask'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentExecutionRequest:
      properties:
        input:
          $ref: '#/components/schemas/AgentExecutionInput-Input'
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        payload_extension:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payload Extension
        parent_execution_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Execution Id
        worker_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Worker Id
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        output_format:
          anyOf:
            - $ref: '#/components/schemas/OutputFormat'
            - type: 'null'
        output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output Schema
        run_locally:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Run Locally
          default: false
        additional_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Additional Context
        instructions_override:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions Override
        test_run_node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Test Run Node Id
        expected_output:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Output
        events_streaming:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Events Streaming
          default: false
        mcp_servers:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Mcp Servers
          default: []
        triggering_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggering Agent Id
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        think_mode:
          anyOf:
            - $ref: '#/components/schemas/ThinkMode'
            - type: 'null'
          default: default
        disable_attachment_injection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Disable Attachment Injection
          default: false
        user_tokens:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Tokens
        user_oidc_token:
          anyOf:
            - type: string
            - type: 'null'
          title: User Oidc Token
        return_metrics:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Return Metrics
          default: false
        llm_model_provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model Provider
          description: >-
            Per-execution override for the LLM provider (e.g. 'openai',
            'anthropic'). Falls back to the agent's configured provider when
            unset.
        llm_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model Name
          description: >-
            Per-execution override for the LLM model name. Falls back to the
            agent's configured model when unset.
        llm_reasoning_effort:
          anyOf:
            - $ref: '#/components/schemas/LLMReasoningEffort'
            - type: 'null'
          description: >-
            Per-execution override for reasoning effort on reasoning-capable
            models.
        source_node_type:
          anyOf:
            - $ref: '#/components/schemas/SourceNodeType'
            - type: 'null'
          description: >-
            Surface that created this execution (mirrored to
            AgentExecutionHistory.source_node_type). Falls back to
            SourceNodeType.SDK at persist time when unset.
      type: object
      required:
        - input
      title: AgentExecutionRequest
    CreatedTask:
      properties:
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        organization_id:
          type: string
          title: Organization Id
        input:
          $ref: '#/components/schemas/AgentExecutionInput-Output'
        status:
          anyOf:
            - $ref: >-
                #/components/schemas/xpander_dev_utils__models__executions__AgentExecutionStatus
            - type: 'null'
          default: pending
        internal_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Internal Status
        last_executed_node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Executed Node Id
        agent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Version
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        paused_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Paused At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        result:
          anyOf:
            - type: string
            - type: 'null'
          title: Result
        parent_execution:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Execution
        sub_executions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sub Executions
          default: []
        finished_sub_executions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Finished Sub Executions
          default: []
        should_update_parent:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Should Update Parent
          default: false
        is_manually_stopped:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Manually Stopped
          default: false
        is_background:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Background
          default: false
        payload_extension:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payload Extension
        hitl_request:
          anyOf:
            - $ref: '#/components/schemas/HumanInTheLoopRequest'
            - type: 'null'
        pending_eca_request:
          anyOf:
            - $ref: '#/components/schemas/PendingECARequest'
            - type: 'null'
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        worker_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Worker Id
        additional_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Additional Context
        instructions_override:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions Override
        expected_output:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Output
        test_run_node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Test Run Node Id
        is_orchestration:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Orchestration
          default: false
        is_gateway:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Gateway
          default: false
        output_format:
          anyOf:
            - $ref: '#/components/schemas/OutputFormat'
            - type: 'null'
          default: text
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice Id
        output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output Schema
        events_streaming:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Events Streaming
          default: false
        used_mutating_tools:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Used Mutating Tools
          default: false
        is_continuous:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Continuous
          default: false
        mcp_servers:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Mcp Servers
          default: []
        triggering_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggering Agent Id
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        think_mode:
          anyOf:
            - $ref: '#/components/schemas/ThinkMode'
            - type: 'null'
          default: default
        disable_attachment_injection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Disable Attachment Injection
          default: false
        deep_planning:
          anyOf:
            - $ref: '#/components/schemas/DeepPlanning'
            - type: 'null'
        execution_attempts:
          anyOf:
            - type: integer
            - type: 'null'
          title: Execution Attempts
          default: 1
        user_tokens:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Tokens
        user_oidc_token:
          anyOf:
            - type: string
            - type: 'null'
          title: User Oidc Token
        return_metrics:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Return Metrics
          default: false
        tokens:
          anyOf:
            - $ref: '#/components/schemas/LLMTokens'
            - type: 'null'
        llm_model_provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model Provider
          description: >-
            Snapshot of the LLM provider used for this execution (request
            override or agent default at run time).
        llm_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model Name
          description: >-
            Snapshot of the LLM model name used for this execution (request
            override or agent default at run time).
        llm_reasoning_effort:
          anyOf:
            - $ref: '#/components/schemas/LLMReasoningEffort'
            - type: 'null'
          description: >-
            Snapshot of the reasoning effort applied during this execution, when
            supported by the model.
      type: object
      required:
        - id
        - agent_id
        - organization_id
        - input
        - created_at
      title: CreatedTask
      description: |-
        Task creation response model.

        Extends AgentExecution with additional agent_id field.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentExecutionInput-Input:
      properties:
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          default: ''
        files:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Files
          default: []
        user:
          anyOf:
            - $ref: '#/components/schemas/User-Input'
            - type: 'null'
      type: object
      title: AgentExecutionInput
    OutputFormat:
      type: string
      enum:
        - text
        - markdown
        - json
        - voice
      title: OutputFormat
    ThinkMode:
      type: string
      enum:
        - default
        - harder
      title: ThinkMode
    LLMReasoningEffort:
      type: string
      enum:
        - low
        - medium
        - high
        - xhigh
      title: LLMReasoningEffort
    SourceNodeType:
      type: string
      enum:
        - workbench
        - sdk
        - task
        - assistant
        - webhook
        - mcp
        - a2a
        - telegram
        - slack
      title: SourceNodeType
    AgentExecutionInput-Output:
      properties:
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          default: ''
        files:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Files
          default: []
        user:
          anyOf:
            - $ref: '#/components/schemas/User-Output'
            - type: 'null'
      type: object
      title: AgentExecutionInput
    xpander_dev_utils__models__executions__AgentExecutionStatus:
      type: string
      enum:
        - pending
        - executing
        - paused
        - error
        - failed
        - completed
        - stopped
      title: AgentExecutionStatus
    HumanInTheLoopRequest:
      properties:
        wait_node_id:
          type: string
          title: Wait Node Id
      type: object
      required:
        - wait_node_id
      title: HumanInTheLoopRequest
      description: |-
        Model representing human-in-the-loop approval records for tasks.

        Attributes:
            wait_node_id (str): The id of the node that triggered this HITL.
    PendingECARequest:
      properties:
        connector_name:
          type: string
          title: Connector Name
        auth_url:
          type: string
          title: Auth Url
      type: object
      required:
        - connector_name
        - auth_url
      title: PendingECARequest
    DeepPlanning:
      properties:
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
          default: false
        enforce:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enforce
          default: false
        started:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Started
          default: false
        question_raised:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Question Raised
          default: false
        tasks:
          anyOf:
            - items:
                $ref: '#/components/schemas/DeepPlanningItem'
              type: array
            - type: 'null'
          title: Tasks
          default: []
      type: object
      title: DeepPlanning
    LLMTokens:
      properties:
        completion_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completion Tokens
          default: 0
        prompt_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prompt Tokens
          default: 0
        total_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Tokens
          default: 0
      type: object
      title: LLMTokens
    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
    User-Input:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        email:
          type: string
          title: Email
        additional_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Additional Attributes
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          default: member
        is_super_admin:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Super Admin
          default: false
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
      type: object
      required:
        - email
      title: User
      description: |-
        Represents the details of a user.

        Attributes:
            id (Optional[str]): The unique identifier of the user. Defaults to None.
            first_name (Optional[str]): The first name of the user. Defaults to None.
            last_name (Optional[str]): The last name of the user. Defaults to None.
            email (str): The email address of the user. This field is required.
            additional_attributes (Optional[dict]): Possible additional parameters for the assistant's service.
            role (Optional[str]): The user's role in the organization. Defaults to "member".
            is_super_admin (Optional[bool]): Whether the user is a super admin. Defaults to False.
            timezone (Optional[str]): The user's timezone in IANA format (e.g. "America/New_York"). Defaults to None.
    User-Output:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        email:
          type: string
          title: Email
        additional_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Additional Attributes
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          default: member
        is_super_admin:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Super Admin
          default: false
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        display_name:
          type: string
          title: Display Name
          readOnly: true
      type: object
      required:
        - email
        - display_name
      title: User
      description: |-
        Represents the details of a user.

        Attributes:
            id (Optional[str]): The unique identifier of the user. Defaults to None.
            first_name (Optional[str]): The first name of the user. Defaults to None.
            last_name (Optional[str]): The last name of the user. Defaults to None.
            email (str): The email address of the user. This field is required.
            additional_attributes (Optional[dict]): Possible additional parameters for the assistant's service.
            role (Optional[str]): The user's role in the organization. Defaults to "member".
            is_super_admin (Optional[bool]): Whether the user is a super admin. Defaults to False.
            timezone (Optional[str]): The user's timezone in IANA format (e.g. "America/New_York"). Defaults to None.
    DeepPlanningItem:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        completed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Completed
          default: false
      type: object
      required:
        - id
        - title
      title: DeepPlanningItem
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````