API Backend
Build a production REST API for AI applications.
Overview
A FastAPI backend with authentication, rate limiting, and multiple AI endpoints.
Time to deploy: ~20 minutes
Quick Deploy
git clone https://github.com/xenoISA/quickstart-api-backend
cd quickstart-api-backend
pip install -r requirements.txt
cp .env.example .env
python main.pyFeatures
- JWT authentication
- Rate limiting
- Multiple agent endpoints
- Streaming support
- OpenAPI documentation
Implementation
from fastapi import FastAPI, Depends, HTTPException
from fastapi.security import HTTPBearer
from isa_agent_sdk import Agent
app = FastAPI(title="AI API")
security = HTTPBearer()
# Agents for different use cases
chat_agent = Agent(name="chat", model="claude-sonnet-4-20250514")
code_agent = Agent(name="code", model="claude-sonnet-4-20250514", tools=["code_interpreter"])
@app.post("/v1/chat")
async def chat(message: str, token: str = Depends(security)):
verify_token(token)
response = await chat_agent.run(message)
return {"response": response.content}
@app.post("/v1/code")
async def code(task: str, token: str = Depends(security)):
verify_token(token)
response = await code_agent.run(task)
return {"response": response.content}Try the API
POST
https://api.isa.io/v1/chatDemo ModeWas this page helpful?