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

# Execute Message

Execute a message in an existing session and get the agent's response.

<ParamField path="session_id" type="string" required>
  The session ID
</ParamField>

## Request Body

<ParamField body="content" type="string | array" required>
  The message content. Can be a simple string or multimodal content blocks.
</ParamField>

<ParamField body="correlation_id" type="string">
  Optional correlation ID for tracking related events
</ParamField>

### Simple Text Message

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.artaios.ai/api/v1/runtime/session_abc123/execute/ \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "What is the weather like today?"
    }'
  ```

  ```python Python theme={null}
  import requests

  data = {
      "content": "What is the weather like today?"
  }

  response = requests.post(
      "https://api.artaios.ai/api/v1/runtime/session_abc123/execute/",
      headers={"x-api-key": "YOUR_API_KEY"},
      json=data
  )
  result = response.json()
  ```

  ```javascript JavaScript theme={null}
  const data = {
    content: "What is the weather like today?"
  };

  const response = await fetch('https://api.artaios.ai/api/v1/runtime/session_abc123/execute/', {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
  });

  const result = await response.json();
  ```
</CodeGroup>

### Multimodal Message (with images)

```json theme={null}
{
  "content": [
    {
      "type": "text",
      "text": "What's in this image?"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/image.jpg"
      }
    }
  ]
}
```

## Response

```json theme={null}
{
  "success": true,
  "message_id": "msg_789",
  "response": {
    "content": "Based on the current weather data, it's sunny and 72°F today.",
    "tool_calls": []
  },
  "correlation_id": "corr_123"
}
```

<Note>
  The response includes the agent's generated content and any tool calls that were made during execution.
</Note>
