Call an external agent
Register a remote A2A endpoint, then invoke it through the AI Gateway Responses API with
model: "agent/<key>".Expose an internal Agent
Give A2A clients a per-Agent endpoint backed by an internal Orq.ai Agent.
Connect an external A2A agent
Registering an external Agent fetches and validates its Agent Card before saving the connection. Orq.ai caches the card for display and discovery metadata, while each invocation discovers the current card before selecting a transport.Register through AI Studio
1
Open the Agent creator
Open a Project or folder in AI Studio, select , select Agent, then select Connect External Agent.
2
Enter the connection
Enter an Agent key, display name, Agent URL, and optional Agent Card URL. Leave the protocol version and preferred transport empty to select a compatible interface from the card automatically.
3
Add authentication headers
Add up to 20 outbound headers. Keep Encrypt enabled for credentials and other secrets.
4
Create the Agent
Select Create agent. Registration succeeds only when the Agent Card is reachable, valid, and advertises the requested protocol and transport.
Register through the API
Use an API key with thea2a.create permission:
cURL
card_url to discover the card from agent_url. Omit protocol_version and preferred_transport to select the first compatible interface advertised by the card.
Encrypted header values are encrypted at rest and returned as empty strings from read operations. When updating an existing encrypted header, send an empty value to preserve the stored secret. Send the complete desired
headers map because the update replaces the map.
List requests accept
limit, starting_after, and ending_before. Do not send both cursor fields in the same request.
Update a connection and revalidate it:
cURL
Invoke an external Agent
Call a registered external Agent through the standard Responses API. Keep theagent/ model prefix:
cURL
Stream output
Setstream: true to receive standard Responses API server-sent events:
cURL
Continue an interrupted task
When a remote task returnsinput_required or auth_required, the Responses API returns an incomplete response. Pass that response ID as previous_response_id to continue the same A2A context:
cURL
previous_response_id.
External Agent limits in v1
External execution in v1 uses a narrow contract:- The remote A2A mapping supports
input,stream, andprevious_response_id. Gateway-managed controls such as response storage still apply. - Accepted input: a string or user messages containing text, image URLs, file URLs, or base64 file data.
- Unsupported request controls include caller-supplied
tools,tool_choice, retries, fallbacks, load balancing, sampling parameters, background mode, and non-default output shaping. instructionsare not applied to the remote Agent. Configure its behavior at the remote endpoint.- Remote file output parts are not mapped in v1. Return text or structured data parts.
- Failed and rejected A2A tasks map to failed Responses. Canceled tasks map to canceled Responses. Input-required and auth-required tasks map to incomplete Responses.
Expose an internal Agent through A2A
Every internal Orq.ai Agent has an A2A endpoint. Open the Agent in Agent Studio, expand Expose via A2A, then copy the Agent URL, Agent Card URL, and requireda2a.execute permission.
Discover the Agent Card
Fetch the standard Agent Card path with a scoped Orq.ai API key:cURL
Send a JSON-RPC message
The base endpoint defaults to the A2A 0.3 compatibility contract whenA2A-Version is absent. Set A2A-Version: 1.0 for the A2A 1.0 contract.
A2A-Version values return 400.
Use another A2A transport
Send the API key as
Authorization: Bearer <token> for HTTP, Connect, and gRPC metadata. The API key must include a2a.execute and access to the Agent’s Project. Authentication, project scope, quota, and rate limits apply before execution.
Ingress limits in v1
- Blocking and streaming message execution are supported.
- Task retrieval and task listing are supported for stored Responses that belong to the routed Agent.
- Non-blocking execution is not supported.
- Task cancellation and task subscriptions are not supported.
- Push notification configuration and extended Agent Cards are not supported.
- Agent Cards advertise
streaming: trueandpushNotifications: false.
Security controls
External Agent registration and execution apply the following controls:- HTTPS is required for Agent, card, and advertised interface URLs.
- Loopback, private, link-local, metadata, and unique-local network targets are blocked before connection, including alternate numeric IP forms and DNS answers that resolve to blocked ranges.
- Redirects are not followed.
- Agent Card size and fetch time are bounded.
- Encrypted headers are masked at API boundaries. Runtime trace headers are managed by Orq.ai and cannot be overridden by stored connection headers.
- Stored headers are sent only to interfaces on the configured agent or card origin. Other advertised interfaces are validated, then excluded before transport selection.
- Project-scoped API keys can only manage, invoke, or expose Agents in allowed Projects.
ENVIRONMENT is local or development and A2A_ALLOW_HTTP_LOCALHOST is true. Keep this setting disabled in deployed environments.
Self-hosted configuration
Set every duration, byte limit, and header limit to a positive integer. In deployed environments, set
A2A_PUBLIC_BASE_URL to the public AI Gateway HTTP origin and A2A_GRPC_PUBLIC_URL to an externally reachable native gRPC target such as agents.example.com:443 or dns:///agents.example.com:443. Do not include http:// or https:// in the gRPC target; clients configure gRPC transport security separately. For authenticated ORQ-to-ORQ gRPC, expose the target through the same public HTTPS host and port as the configured agent or card URL so origin-bound stored headers remain eligible for that interface.