AI
Run a stateless AI agent with tools
π€ AI Agent with Tool Use
Run an AI agent that autonomously uses built-in tools and external webhooks in a loop until a stop condition is met.
π§ Built-in Tools (specify names in agent.tools)
- web_search β real-time web search
- fetch_url β HTTP fetch any URL
- run_code β execute code in a sandbox
- rag_search β search project knowledge base
- generate_image / edit_image β AI image generation
- generate_video / image_to_video β AI video generation
- db_insert/list/get/update/delete β database CRUD operations
- storage_upload/download/list/delete β file storage operations
Custom webhook tools call your own HTTPS endpoints; each request is signed (Standard Webhooks headers) with the project's webhook signing secret.
π± Client Tools
- Define tools executed on the client side (streaming mode only)
- Tool calls are forwarded in the SSE stream; client sends results back
π‘ Streaming
- Set stream: true to receive a Vercel AI SDK data stream (SSE)
- Includes tool calls and results as they occur in real time
post/api/ai/{project_id}/agent
Request
- Base URLhttps://core.blink.new
- URLhttps://core.blink.new/api/ai/{project_id}/agent
- AuthHTTP bearer
Path parameters
project_idstring required
Example:my-project-123
Unique identifier for the project
Request body
Example request
{
"prompt": "Search the web for the latest AI news and summarize the top 3 stories",
"agent": {
"model": "google/gemini-3-flash",
"system": "You are a helpful assistant that can search the web and analyze data.",
"tools": [
"web_search",
"fetch_url"
],
"webhook_tools": [
{
"name": "create_ticket",
"description": "Create a support ticket in the ticketing system",
"input_schema": {
"type": "object",
"properties": {
"filter": {
"type": "string"
}
}
},
"webhook_url": "https://myapp.com/api/agent/tools/create_ticket"
}
],
"stop_when": [
{
"count": 20
}
]
}
}Response
Agent execution successful
Example response
{
"text": "Based on my research, AI is...",
"usage": {
"inputTokens": 150,
"outputTokens": 300,
"totalTokens": 450
},
"_billing": {
"model": "anthropic/claude-sonnet-4-20250514",
"creditsCharged": 2.5,
"costUSD": 0.625
}
}Changes
No recorded changes to this operation across all 1 revision of this API.