Create A2A Agent
POST /a2a_agents
POST /a2a_agentsInteractive request editor loads with JavaScript.
Authorization
BearerAdminToken Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.
In: header
Request Body
application/json
Register an organization-scoped A2A agent and select the environments allowed to expose it.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "$AISIX_CP/a2a_agents" \ -H "Authorization: Bearer $AISIX_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "url": "http://example.com" }'Created
{
"a2a_agent": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"name": "string",
"url": "http://example.com",
"protocol_version": "1.0",
"auth_type": "none",
"timeout_ms": 1,
"enabled": true,
"allowed_environments": [
"2f8fd63c-350f-4e43-9e38-47af879eaada"
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}Request body or parameters failed validation.
{
"error": {
"code": "string",
"message": "string"
}
}Missing or invalid bearer.
{
"error": {
"code": "UNAUTHENTICATED",
"message": "no org context"
}
}Authenticated request is not permitted.
{
"error": {
"code": "CUSTOM_KEY_DISABLED",
"message": "custom API key values are disabled for this organization"
}
}Request conflicts with current resource state.
{
"error": {
"code": "CREDENTIAL_IN_USE",
"message": "models still reference this provider_key"
}
}Complete operation details and schema variants
POST /a2a_agents
Create A2A Agent
Register an upstream A2A agent and expose it to the allowed environments.
Parameters
Request body
Content type: application/json
-
name(string, required): Organization-unique name used as the URL path segment. May contain letters, digits,_,., and-, but cannot start or end with a separator character. -
url(string, required): Upstream A2A agent URL. -
protocol_version(string, optional): A2A wire-format version. Defaults to1.0when omitted. -
auth_type(string, optional): Authentication mode used when AISIX connects to the upstream agent. Defaults tononewhen omitted. -
secret(string, optional): The credential — a bearer token or an API key depending onauth_type; write-only (envelope-encrypted on the server, never returned). Required forbearer/api_key; must be absent/empty whenauth_typeisnone. -
timeout_ms(integer, optional): Per-request timeout in milliseconds. -
enabled(boolean, optional): Whether the agent is dispatched to the data plane. -
allowed_environments(array, optional): Environments this agent is exposed to. Empty or null values expose it to no environment.
Responses
-
201: Created -
a2a_agent(object, required): An upstream A2A (Agent-to-Agent) agent registered at the organization level and exposed to the environments listed inallowed_environments. Thesecret(bearer token or API key depending onauth_type) is write-only and never appears in this view. -
a2a_agent.id(string, required): A2A agent ID. -
a2a_agent.org_id(string, required): Organization ID that owns this A2A agent. -
a2a_agent.name(string, required): Organization-unique name used as the URL path segment the agent is exposed under. Names may contain letters, digits,_,., and-, but cannot start or end with a separator character. -
a2a_agent.url(string, required): Upstream A2A agent URL. -
a2a_agent.protocol_version(string, required): A2A wire-format version pinned for this agent. -
a2a_agent.auth_type(string, required): How AISIX authenticates to the upstream agent.none= no credential;bearer= a bearer token supplied assecret;api_key= an API key supplied assecretand sent as thex-api-keyheader. -
a2a_agent.timeout_ms(integer, optional): Per-request timeout in milliseconds. AISIX applies its default when this value is unset. -
a2a_agent.enabled(boolean, required): Whether the agent is dispatched to the data plane. -
a2a_agent.allowed_environments(array, required): Environment UUIDs this agent is projected to. Empty array = projected to no environment. -
a2a_agent.created_at(string, required): Time when the A2A agent was created. -
a2a_agent.updated_at(string, required): Time when the A2A agent was last updated. -
400: Request body or parameters failed validation. -
error(object, required): Error details. -
error.code(string, required): Machine-readable identifier. Examples:UNAUTHENTICATED,INVALID_REQUEST,MASTER_KEY_UNSET,INTERNAL. -
error.message(string, required): Human-readable explanation; safe to surface to operators. -
401: Missing or invalid bearer. Response fields (application/json): identical toPOST /a2a_agents, response 400 above. -
403: Authenticated request is not permitted. Response fields (application/json): identical toPOST /a2a_agents, response 400 above. -
409: Request conflicts with current resource state. Response fields (application/json): identical toPOST /a2a_agents, response 400 above.
cURL
curl -X POST '$AISIX_CP/a2a_agents' -H 'Authorization: Bearer $AISIX_TOKEN'