POST
/
v1
/
agents
智能体对话
curl --request POST \
  --url https://open.bigmodel.cn/api/v1/agents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "agent_id": "doc_translation_agent",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "file_id",
          "file_id": "agent_1750681215_9b92722d788f4b32bab28cc333293584"
        }
      ]
    }
  ]
}'
{
  "id": "<string>",
  "agent_id": "<string>",
  "conversation_id": "<string>",
  "async_id": "<string>",
  "choices": [
    {
      "index": 123,
      "messages": [
        {
          "role": "assistant",
          "content": "<string>"
        }
      ],
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

使用以下格式进行身份验证:Bearer <your api key>

Body

application/json

Response

200
application/json

业务处理成功

The response is of type object.