Pular para o conteúdo principal
POST
/
api
/
v1
/
agents
Python (SDK)
from openapi import SDK, models


with SDK() as sdk:

    res = sdk.agents.create_agent(security=models.CreateAgentSecurity(
        bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
    ), name="release-research-agent", model="functionary-pt", description="Looks up current release information before answering.", instructions="Use web search when the question depends on current external information.", tools=[
        {
            "type": "web_search",
            "search_context_size": "medium",
        },
    ], tool_choice="auto", parallel_tool_calls=True)

    # Handle response
    print(res)
{
  "object": "agent",
  "id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "model": "functionary-pt",
  "instructions": "<string>",
  "tools": [
    {
      "type": "web_search",
      "search_context_size": "low",
      "user_location": {
        "type": "approximate",
        "city": "<string>",
        "country": "<string>",
        "region": "<string>",
        "timezone": "<string>"
      },
      "filters": {
        "allowed_domains": [
          "<string>"
        ]
      }
    }
  ],
  "tool_choice": "<string>",
  "parallel_tool_calls": true,
  "max_tool_calls": 123,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "reasoning": {
    "effort": "low"
  },
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "deleted_at": "2023-11-07T05:31:56Z"
}

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Cabeçalhos

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Corpo

application/json
name
string
obrigatório
Required string length: 1 - 120
model
string
obrigatório
Minimum string length: 1
Exemplo:

"functionary-pt"

description
string | null
Maximum string length: 2000
instructions
string | null
Maximum string length: 20000
tools
object[]
tool_choice
parallel_tool_calls
boolean
padrão:true
max_tool_calls
integer | null
Intervalo obrigatório: 1 <= x <= 300
text
object
reasoning
object
metadata
object

Resposta

Agente criado.

object
enum<string>
obrigatório
Opções disponíveis:
agent
id
string
obrigatório
name
string
obrigatório
description
string | null
obrigatório
model
string
obrigatório
Exemplo:

"functionary-pt"

instructions
string | null
obrigatório
tools
object[]
obrigatório
tool_choice
obrigatório
parallel_tool_calls
boolean
obrigatório
max_tool_calls
integer | null
obrigatório
text
object
obrigatório
reasoning
object
obrigatório
metadata
object
obrigatório
created_at
string<date-time>
obrigatório
updated_at
string<date-time>
obrigatório
deleted_at
string<date-time> | null
obrigatório