Skip to content

AI Agents

Universal API hosts AI Agents powered by AWS Strands SDK and AWS Bedrock. Agents are conversational AI assistants that can use tools, maintain multi-turn conversations, and perform complex tasks.

Key Features

  • Streaming responses — Real-time text streaming via Server-Sent Events
  • Multi-turn conversations — Automatic session management with conversation history
  • Tool use — Connect to any MCP server's tools, or define custom tools
  • Multiple LLM models — Claude, Nova, Llama, Mistral via AWS Bedrock
  • Platform Bedrock — No AWS account needed — use Bedrock models for free (credit-based)
  • Serverless — No infrastructure to manage, scales automatically

How It Works

User sends prompt → Agent Runtime (Lambda)
    → Loads agent source code
    → Creates Strands Agent with BedrockModel
    → Agent reasons + calls tools as needed
    → Streams response back to user
    → Saves conversation to S3 for multi-turn

Quick Example

Chat with an agent:

bash
curl -s -X POST https://stream.api.universalapi.co/agent/AGENT_ID/chat \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "What is the weather in Denver?"}'

Response (streamed):

I'll help you find the weather in Denver! Let me search for that...

Based on my search, Denver currently has clear skies with a temperature of 45°F (7°C).

__META__{"conversationId":"conv-abc123","agentId":"agent-xxx","bedrockProvider":"platform"}
__METRICS__{"totalCycles":2,"totalTokens":1500,"toolsUsed":["google_search"]}

Available Bedrock Models

ModelModel IDBest For
Claude Sonnet 4us.anthropic.claude-sonnet-4-20250514-v1:0General purpose (recommended)
Claude 3.5 Haikuus.anthropic.claude-3-5-haiku-20241022-v1:0Fast, cheap tasks
Claude 3 Opusus.anthropic.claude-3-opus-20240229-v1:0Complex reasoning
Nova Microus.amazon.nova-micro-v1:0Ultra-cheap, simple tasks
Nova Prous.amazon.nova-pro-v1:0Good balance of cost/quality
Llama 3.3 70Bus.meta.llama3-3-70b-instruct-v1:0Open-source alternative
Mistral Large 2mistral.mistral-large-2407-v1:0Multilingual tasks

Endpoints

MethodEndpointDescription
POST/agent/createCreate a new agent
GET/agent/listList all agents
GET/agent/{agentId}Get agent details
GET/agent/s/{owner}/{slug}Get agent by slug
PUT/agent/updateUpdate an agent
DELETE/agent/deleteDelete an agent
POSTstream.api.universalapi.co/agent/{agentId}/chatChat with agent
GET/agent/{agentId}/conversationsList conversations
GET/agent/{agentId}/conversations/{conversationId}Get conversation history

Next Steps

Universal API - The agentic entry point to the universe of APIs