Skip to main content
POST
/
v1
/
agent
/
completions
Execute Agent Completion
curl --request POST \
  --url https://api.example.com/v1/agent/completions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "agent_config": {
    "agent_name": "<string>",
    "description": "<string>",
    "system_prompt": "<string>",
    "model_name": "gpt-4.1",
    "auto_generate_prompt": false,
    "max_tokens": 8192,
    "temperature": 0.5,
    "role": "worker",
    "max_loops": 1,
    "tools_list_dictionary": [
      {}
    ],
    "mcp_url": "<string>",
    "streaming_on": false,
    "llm_args": {},
    "dynamic_temperature_enabled": true,
    "mcp_config": {
      "type": "mcp",
      "url": "http://localhost:8000/mcp",
      "tool_configurations": {},
      "authorization_token": "<string>",
      "transport": "streamable_http",
      "headers": {},
      "timeout": 10
    },
    "mcp_configs": {
      "connections": [
        {
          "type": "mcp",
          "url": "http://localhost:8000/mcp",
          "tool_configurations": {},
          "authorization_token": "<string>",
          "transport": "streamable_http",
          "headers": {},
          "timeout": 10
        }
      ]
    },
    "tool_call_summary": true,
    "reasoning_effort": "<string>",
    "thinking_tokens": 123,
    "reasoning_enabled": false
  },
  "task": "<string>",
  "history": {},
  "img": "<string>",
  "imgs": [
    "<string>"
  ],
  "tools_enabled": [
    "<string>"
  ]
}
'
{
  "job_id": "<string>",
  "success": true,
  "name": "<string>",
  "description": "<string>",
  "temperature": 123,
  "outputs": "<unknown>",
  "usage": {},
  "timestamp": "<string>"
}

Headers

x-api-key
string
required

Body

application/json
agent_config
AgentSpec · object
required

The configuration of the agent to be completed.

task
string | null

The task to be completed by the agent.

history
History · object

The history of the agent's previous tasks and responses. Can be either a dictionary or a list of message objects.

img
string | null

An optional image URL that may be associated with the agent's task or representation.

imgs
string[] | null

A list of image URLs that may be associated with the agent's task or representation.

tools_enabled
string[] | null

A list of tools that the agent should use to complete its task.

Response

Successful Response

job_id
string | null

The unique identifier for the agent completion.

success
boolean | null
default:true

Indicates whether the agent completion was successful.

name
string | null

The name of the agent.

description
string | null

A description of the agent or completion.

temperature
number | null

The temperature setting used for the agent's response generation.

outputs
any | null

The outputs generated by the agent.

usage
Usage · object

Usage statistics or metadata for the agent completion.

timestamp
string | null

The timestamp when the agent completion was created.