Built with Rust 🦀
Open Source
Agentic tooling platform ⚡️
Instant API access for your AI agent.
Auth? ✅ Schema? ✅ Network? ✅ Domain Knowledge? ✅ No hassle. 🚀
Connect 1 or 3141 APIs—AI's cool with it… unlike your tech lead.
1. Install dependencies
bash
1npm install ai openai @picahq/ai
2. Create API route
typescript
1import { openai } from "@ai-sdk/openai";
2import { convertToCoreMessages, streamText } from "ai";
3import { Pica } from "@picahq/ai";
4
5export async function POST(request: Request) {
6 const { messages } = await request.json();
7
8 const pica = new Pica(process.env.PICA_SECRET_KEY as string);
9
10 const systemPrompt = await pica.generateSystemPrompt();
11
12 const stream = streamText({
13 model: openai("gpt-4o"),
14 system: systemPrompt,
15 tools: { ...pica.oneTool },
16 messages: convertToCoreMessages(messages),
17 maxSteps: 5,
18 });
19
20 return (await stream).toDataStreamResponse();
21}
3. Test the endpoint
bash
1curl --location 'http://localhost:3000/api/ai' \
2--header 'Content-Type: application/json' \
3--data '{
4 "messages": [{"role": "user", "content": "What connections do I have access to?"}]
5}'
Frequently Asked Questions
Everything you need to know about Pica