AI

Invoke a specific agent

This route allows you to create an agent's invocation.<br/><br/>To learn more about AI agents, check out the documentation.

post/v1/agent/{identifier}/invoke

Request

  • Base URL: https://api.port.io
  • URL: https://api.port.io/v1/agent/{identifier}/invoke
  • Auth: API key in header Authorization

Path parameters

identifierstring required

The identifier of the agent you want to operate on.

Query parameters

invocation_identifierstring

Optional existing invocation id when continuing a multi-step interaction.

conversation_identifierstring

Conversation ID for clients continuing a thread.

streamboolean

If true, response may stream (when supported) instead of a single payload.

use_mcpboolean

If true, MCP tools may be used for this invocation when configured.

Request body

promptstring

The user's message or query to be processed by the AI agent.

labelsobject

Optional meta-data about the invocation.

provider'openai' | 'azure-openai' | 'anthropic' | 'azure-anthropic' | 'bedrock' | 'port' | 'openai-compatible' | 'vertex-gemini' | 'vertex-anthropic' | 'anthropic-compatible'

The AI provider for this invocation. Use openai-compatible, anthropic-compatible, vertex-gemini, or vertex-anthropic with a model you registered via the LLM management API. See the OpenAI compatible, Anthropic compatible, Vertex Gemini, and Vertex Anthropic setup guides.

asyncboolean

If true, the invocation runs in the background and returns immediately with an invocation identifier.

Response

Default Response

okboolean required
invocationIdentifierstring required

The invocation id to use when polling for results.

traceIDstring required

Changes

No recorded changes to this operation across all 1 revision of this API.