Skip to main content
This is a beta feature according to Algolia’s Terms of Service (“Beta Services”).
Required ACL: search This endpoint handles two types of requests:
  1. Normal completion request: User message -> Agent response
  2. Tool approval response: User approval -> Execute tool -> Agent response
Tool Approval Flow (for MCP tools with requiresApproval: true):
  • Request 1: User sends message -> Agent requests tool call -> Return approval request
  • Request 2: User approves -> Execute tool -> Agent continues with result.
Streaming is supported in JavaScript and Python only. The JavaScript client provides createAgentCompletionStream and the Python client provides create_agent_completion_stream. Other languages only support non-streaming completions.

Usage

// Initialize the client
var client = new AgentStudioClient(
  new AgentStudioConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);

// Call the API
var response = await client.CreateAgentCompletionAsync(
  "76710f1b-8231-42e5-b0d1-f43aac618e15",
  Enum.Parse<CompatibilityMode>("AiSdk4"),
  new AgentCompletionRequest
  {
    Messages = new MessagesUnion(
      new List<MessageV4>
      {
        new MessageV4(new UserMessageV4 { Role = "user", Content = "Hello, how are you?" }),
      }
    ),
  }
);

// print the response
Console.WriteLine(response);

See the full API reference

For more details about input parameters and response fields.
Last modified on June 12, 2026