### GET / Source: https://core.blink.new/openapi.json Returns basic information about the Blink APIs ```markdown ### Responses #### 200 - API information - **message** (string) (example: "Blink APIs - Express on Vercel") - **timestamp** (string (date-time)) - **status** (string) (example: "running") ### Example Usage ```bash curl -X GET "https://core.blink.new/" ``` ``` -------------------------------- ### GET /api/queue/{project_id}/queues Source: https://core.blink.new/openapi.json API endpoint for GET /api/queue/{project_id}/queues ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Responses #### 200 - Queue list with task counts - **queues** (array (object)) #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/queue/{project_id}/queues" ``` ``` -------------------------------- ### GET /api/queue/{project_id}/schedules Source: https://core.blink.new/openapi.json API endpoint for GET /api/queue/{project_id}/schedules ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Responses #### 200 - List of schedules - **schedules** (array (object)) #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/queue/{project_id}/schedules" ``` ``` -------------------------------- ### GET /api/storage/{project_id}/download Source: https://core.blink.new/openapi.json Returns a 15-minute signed URL that forces a browser download via `Content-Disposition: attachment`. The signed URL is self-contained and requires no additional authentication to access. Use the `filename` query parameter to override the name shown to the user during download. ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") - **path** (string, query, required): Relative path to the file within the project bucket (example: "uploads/my-document.pdf") - **filename** (string, query, optional): Override the download filename shown to the user. Defaults to the file's basename. (example: "My Document.pdf") ### Responses #### 200 - Signed download URL generated successfully - **data** (object) - **downloadUrl** (string (uri)): Signed URL valid for 15 minutes that triggers a file download - **filename** (string): Filename used in the Content-Disposition attachment header (example: "my-document.pdf") - **contentType** (string): Detected MIME type of the file (example: "application/pdf") - **size** (integer): File size in bytes (example: 204800) - **error** (unknown) (example: null) #### 400 - Missing required path parameter or project ID **StorageResponse** - **data** (object) - **id** (string (uuid)) - **name** (string) - **bucket_id** (string) - **owner** (string) - **owner_id** (string) - **version** (string) - **created_at** (string (date-time)) - **updated_at** (string (date-time)) - **last_accessed_at** (string (date-time)) - **metadata** (object) - **size** (integer) - **mimetype** (string) - **cacheControl** (string) - **user_metadata** (object) - **error** (object) - **message** (string) - **statusCode** (string) #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 404 - File not found at the specified path **StorageResponse** - **data** (object) - **id** (string (uuid)) - **name** (string) - **bucket_id** (string) - **owner** (string) - **owner_id** (string) - **version** (string) - **created_at** (string (date-time)) - **updated_at** (string (date-time)) - **last_accessed_at** (string (date-time)) - **metadata** (object) - **size** (integer) - **mimetype** (string) - **cacheControl** (string) - **user_metadata** (object) - **error** (object) - **message** (string) - **statusCode** (string) #### 500 - Storage error or failed to generate signed URL **StorageResponse** - **data** (object) - **id** (string (uuid)) - **name** (string) - **bucket_id** (string) - **owner** (string) - **owner_id** (string) - **version** (string) - **created_at** (string (date-time)) - **updated_at** (string (date-time)) - **last_accessed_at** (string (date-time)) - **metadata** (object) - **size** (integer) - **mimetype** (string) - **cacheControl** (string) - **user_metadata** (object) - **error** (object) - **message** (string) - **statusCode** (string) ### Example Usage ```bash curl -X GET "https://core.blink.new/api/storage/{project_id}/download?path=uploads/my-document.pdf&filename=My Document.pdf" ``` ``` -------------------------------- ### GET /api/storage/{project_id}/list Source: https://core.blink.new/openapi.json Returns files and directories at the given path level within the project's storage bucket. Uses a directory delimiter so only items at the specified depth are returned (non-recursive). Both file objects and directory prefixes are included in the response array. Response format is compatible with the Supabase Storage `list` API. ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") - **path** (string, query, optional): Folder prefix to list. Omit or pass empty string for the project root. (example: "images/avatars") - **limit** (integer, query, optional): Maximum number of file objects to return (example: 100) - **offset** (integer, query, optional): Number of file objects to skip (applied after search filter, for pagination) (example: 0) - **search** (string, query, optional): Case-insensitive substring filter applied to file names (example: "avatar") ### Responses #### 200 - List of files and directories at the given path **StorageResponse** - **data** (object) - **id** (string (uuid)) - **name** (string) - **bucket_id** (string) - **owner** (string) - **owner_id** (string) - **version** (string) - **created_at** (string (date-time)) - **updated_at** (string (date-time)) - **last_accessed_at** (string (date-time)) - **metadata** (object) - **size** (integer) - **mimetype** (string) - **cacheControl** (string) - **user_metadata** (object) - **error** (object) - **message** (string) - **statusCode** (string) #### 400 - Missing project ID **StorageResponse** - **data** (object) - **id** (string (uuid)) - **name** (string) - **bucket_id** (string) - **owner** (string) - **owner_id** (string) - **version** (string) - **created_at** (string (date-time)) - **updated_at** (string (date-time)) - **last_accessed_at** (string (date-time)) - **metadata** (object) - **size** (integer) - **mimetype** (string) - **cacheControl** (string) - **user_metadata** (object) - **error** (object) - **message** (string) - **statusCode** (string) #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 500 - Storage error **StorageResponse** - **data** (object) - **id** (string (uuid)) - **name** (string) - **bucket_id** (string) - **owner** (string) - **owner_id** (string) - **version** (string) - **created_at** (string (date-time)) - **updated_at** (string (date-time)) - **last_accessed_at** (string (date-time)) - **metadata** (object) - **size** (integer) - **mimetype** (string) - **cacheControl** (string) - **user_metadata** (object) - **error** (object) - **message** (string) - **statusCode** (string) ### Example Usage ```bash curl -X GET "https://core.blink.new/api/storage/{project_id}/list?path=images/avatars&limit=100&offset=0&search=avatar" ``` ``` -------------------------------- ### GET /api/db/{project_id}/rest/v1/{table} Source: https://core.blink.new/openapi.json PostgREST-compatible SELECT endpoint backed by Turso SQLite. **Authentication** - Public tables (configured via security policy) can be read without a token (capped at 100 rows per request for unauthenticated callers). - All other tables require a valid bearer token. - Service-role tokens bypass row-level security (RLS). **Row-Level Security (RLS)** When authenticated with a non-service token and the table is not public, a `WHERE user_id = ` filter is automatically appended (the owner field name is configurable via the project's security policy). **Filtering — column operators** | Syntax | SQL equivalent | Example | |--------|----------------|---------| | `?col=value` | `col = 'value'` | `?status=active` | | `?col=eq.value` | `col = 'value'` | `?status=eq.active` | | `?col=gt.value` | `col > value` | `?age=gt.18` | | `?col=gte.value` | `col >= value` | `?score=gte.50` | | `?col=lt.value` | `col < value` | `?price=lt.100` | | `?col=lte.value` | `col <= value` | `?quantity=lte.5` | | `?col=like.pattern` | `col LIKE pattern` | `?name=like.Ali%25` | | `?col=in.(a,b,c)` | `col IN (a, b, c)` | `?status=in.(active,pending)` | | `?col=is.null` | `col IS NULL` | `?deleted_at=is.null` | | `?not.col=eq.value` | `NOT (col = value)` | `?not.status=eq.archived` | **Logical groups** - `?and(col1.eq.val1,col2.gt.5)` — all conditions must match - `?or(col1.eq.val1,col2.eq.val2)` — any condition must match ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") - **table** (string, path, required): Table name (alphanumeric + underscores) (example: "users") - **select** (string, query, optional): Comma-separated list of columns to return. Omit for all columns (`*`). (example: "id,name,email") - **order** (string, query, optional): Sort columns. Format `col.asc` or `col.desc`, comma-separated. (example: "created_at.desc,name.asc") - **limit** (integer, query, optional): Maximum number of rows to return. (example: 20) - **offset** (integer, query, optional): Number of rows to skip (for pagination). (example: 40) ### Responses #### 200 - Array of matching records - Array of object #### 400 - Invalid table name, column name, or filter expression **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 401 - Unauthenticated access to a non-public table **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 403 - Table access denied by security policy, or RLS owner column missing **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 404 - No database found for the given project_id **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 500 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/db/{project_id}/rest/v1/{table}?select=id,name,email&order=created_at.desc,name.asc&limit=20&offset=40" ``` ``` -------------------------------- ### API Overview: Blink APIs Source: https://core.blink.new/openapi.json Backend APIs for Blink projects — AI generation, database, storage, realtime, data extraction, and more. Each project gets isolated resources scoped by `project_id`. Use a project secret key (`blnk_sk_...`) for project-scoped endpoints or a workspace API key (`blnk_ak_...`) for v1 endpoints. **OpenAPI schema:** [JSON](https://core.blink.new/openapi.json) · [YAML](https://core.blink.new/openapi.yaml) ```yaml # Blink APIs # Version: 1.0.0 Backend APIs for Blink projects — AI generation, database, storage, realtime, data extraction, and more. Each project gets isolated resources scoped by `project_id`. Use a project secret key (`blnk_sk_...`) for project-scoped endpoints or a workspace API key (`blnk_ak_...`) for v1 endpoints. **OpenAPI schema:** [JSON](https://core.blink.new/openapi.json) · [YAML](https://core.blink.new/openapi.yaml) # Base URL: https://core.blink.new ``` -------------------------------- ### GET /api/queue/{project_id}/tasks Source: https://core.blink.new/openapi.json Returns a paginated list of tasks. Filterable by status and queue name. ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") - **status** (string (pending|completed|failed|cancelled), query, optional): Filter by task status (`failed` maps to internal `dead`) - **queue** (string, query, optional): Filter by named queue - **limit** (integer, query, optional) - **offset** (integer, query, optional) ### Responses #### 200 - Task list - **tasks** (array (object)) - **total** (integer) #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/queue/{project_id}/tasks?status=pending&queue=string&limit=50&offset=0" ``` ``` -------------------------------- ### GET /api/realtime/{project_id}/messages Source: https://core.blink.new/openapi.json Retrieve historical messages from a realtime channel, returned in chronological order. Use `start` and `end` (cursor IDs in `{ms}-{seq}` format) to paginate through history. Use `"-"` for the beginning and `"+"` for the latest message. Maximum of 1 000 messages can be returned in a single request. ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") - **channel** (string, query, required): Name of the channel to fetch messages from (example: "chat-room-1") - **limit** (integer, query, optional): Maximum number of messages to return (capped at 1 000) (example: 50) - **start** (string, query, optional): Cursor ID to start from (inclusive). Use "-" for the oldest available message. (example: "1640995100000-0") - **end** (string, query, optional): Cursor ID to end at (inclusive). Use "+" for the latest message. (example: "+") ### Responses #### 200 - Messages retrieved successfully **RealtimeMessagesResponse** - **channel** (string): Channel name - **messages** (array (object)): List of messages in the channel Array items: - **id** (string): Message ID - **type** (string): Message type - **data** (unknown): Message payload - **timestamp** (integer): Unix timestamp - **userId** (string): User who sent the message - **metadata** (object): Message metadata - **count** (integer): Number of messages returned - **hasMore** (boolean): Whether there are more messages available #### 400 - Missing or invalid parameters **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 500 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/realtime/{project_id}/messages?channel=chat-room-1&limit=50&start=1640995100000-0&end=+" ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/connect Source: https://core.blink.new/openapi.json Connects to a sandbox, auto-resumes if paused ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **sandbox_id** (string) (required) - **timeout_ms** (number) ### Responses #### 200 - Connected to sandbox Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/connect" \ -H "Content-Type: application/json" \ -d '{ "sandbox_id": "string", "timeout_ms": "0" }' ``` ``` -------------------------------- ### POST /api/db/{project_id}/sql Source: https://core.blink.new/openapi.json Execute a raw SQL query against the project's SQLite database. Use positional parameters (`params` or `args`) to avoid injection. Accepts `params`, `args`, or `named_args` interchangeably. Use `?` placeholders in the query when using `params`/`args`. **⛔ Forbidden SQL keywords (returns 403):** `DROP`, `TRUNCATE`, `ALTER`, `CREATE USER`, `GRANT`, `REVOKE` All other SQL (SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, etc.) is executed verbatim against the underlying database. ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **query** (string) (required): SQL query to execute (use $1, $2, etc. for parameters) (example: "SELECT * FROM users WHERE status = $1 AND age > $2") - **params** (array (union)): Query parameters in order (example: ["active",18]) ### Responses #### 200 - Query executed successfully **SqlResponse** - **rows** (array (object)): Query result rows - **columns** (array (string)): Column names - **rowCount** (integer): Number of rows returned/affected - **executionTime** (number): Query execution time in milliseconds #### 400 - Missing or invalid SQL query **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 401 - No authentication token provided **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 403 - Service role required, or the SQL statement uses a forbidden keyword **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 404 - No database found for the given project_id **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 500 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/db/{project_id}/sql" \ -H "Content-Type: application/json" \ -d '{ "query": "SELECT * FROM users WHERE status = $1 AND age > $2", "params": [ "active", 18 ] }' ``` ``` -------------------------------- ### GET /api/rag/{project_id}/documents Source: https://core.blink.new/openapi.json API endpoint for GET /api/rag/{project_id}/documents ```markdown ### Parameters - **project_id** (string, path, required) - **collection_id** (string, query, optional) - **status** (string (pending|processing|ready|error), query, optional) ### Responses #### 200 - List of documents Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/rag/{project_id}/documents?collection_id=string&status=pending" ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/files/write Source: https://core.blink.new/openapi.json API endpoint for POST /api/sandbox/{project_id}/files/write ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **sandbox_id** (string) (required) - **path** (string) (required) - **content** (string) (required) ### Responses #### 200 - File written Empty response body ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/files/write" \ -H "Content-Type: application/json" \ -d '{ "sandbox_id": "string", "path": "string", "content": "string" }' ``` ``` -------------------------------- ### POST /api/db/create Source: https://core.blink.new/openapi.json Deprecated — returns `501 Not Implemented`. Database provisioning is now automatic. ```markdown ### Request Body **Content-Type:** application/json - **project_id** (string) (required): Unique identifier for the project (example: "my-project-123") ### Responses #### 200 - Database created successfully (no longer reachable — see 501) **CreateDatabaseResponse** - **success** (boolean) (example: true) - **database** (object) - **name** (string): Database name (example: "my-project-123") - **url** (string): Database connection URL (example: "libsql://my-project-123-turso.turso.io") - **project_id** (string): Project identifier (example: "my-project-123") - **message** (string) (example: "Database created successfully") #### 201 - Database created successfully **CreateDatabaseResponse** - **success** (boolean) (example: true) - **database** (object) - **name** (string): Database name (example: "my-project-123") - **url** (string): Database connection URL (example: "libsql://my-project-123-turso.turso.io") - **project_id** (string): Project identifier (example: "my-project-123") - **message** (string) (example: "Database created successfully") #### 400 - Invalid or missing project_id **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 409 - A database already exists for this project **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 500 - Database creation failed - **error** (string) (example: "Database creation failed") - **code** (string) (example: "INTERNAL_ERROR") - **message** (string) (example: "Failed to provision database resources") #### 501 - Deprecated — database creation is now handled automatically **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/db/create" \ -H "Content-Type: application/json" \ -d '{ "project_id": "my-project-123" }' ``` ``` -------------------------------- ### GET /api/rag/{project_id}/collections Source: https://core.blink.new/openapi.json API endpoint for GET /api/rag/{project_id}/collections ```markdown ### Parameters - **project_id** (string, path, required) ### Responses #### 200 - List of collections Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/rag/{project_id}/collections" ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/create Source: https://core.blink.new/openapi.json Creates a persistent E2B sandbox with auto-pause enabled ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **template** (string): Sandbox template (devtools-base, vite-react, nextjs-app, etc.) - **timeout_ms** (number): Timeout in milliseconds (default 5min, max 60min) - **metadata** (object): Custom metadata ### Responses #### 201 - Sandbox created Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/create" \ -H "Content-Type: application/json" \ -d '{ "template": "string", "timeout_ms": "0", "metadata": "value" }' ``` ``` -------------------------------- ### GET /api/queue/{project_id}/tasks/{taskId} Source: https://core.blink.new/openapi.json API endpoint for GET /api/queue/{project_id}/tasks/{taskId} ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") - **taskId** (string, path, required) (example: "tsk_aBcDeFgHiJkL") ### Responses #### 200 - Task object Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 404 - Task not found Task not found ### Example Usage ```bash curl -X GET "https://core.blink.new/api/queue/{project_id}/tasks/{taskId}" ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/exec Source: https://core.blink.new/openapi.json API endpoint for POST /api/sandbox/{project_id}/exec ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **sandbox_id** (string) (required) - **command** (string) (required) - **background** (boolean) - **cwd** (string) - **envs** (object) ### Responses #### 200 - Command executed Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/exec" \ -H "Content-Type: application/json" \ -d '{ "sandbox_id": "string", "command": "string", "background": "true", "cwd": "string", "envs": "value" }' ``` ``` -------------------------------- ### GET /api/rag/{project_id}/documents/{document_id} Source: https://core.blink.new/openapi.json API endpoint for GET /api/rag/{project_id}/documents/{document_id} ```markdown ### Parameters - **project_id** (string, path, required) - **document_id** (string, path, required) ### Responses #### 200 - Document details with status Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 404 - Document not found Document not found ### Example Usage ```bash curl -X GET "https://core.blink.new/api/rag/{project_id}/documents/{document_id}" ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/files/list Source: https://core.blink.new/openapi.json API endpoint for POST /api/sandbox/{project_id}/files/list ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **sandbox_id** (string) (required) - **path** (string) (required) ### Responses #### 200 - Directory entries Empty response body ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/files/list" \ -H "Content-Type: application/json" \ -d '{ "sandbox_id": "string", "path": "string" }' ``` ``` -------------------------------- ### GET /api/rag/{project_id}/collections/{collection_id} Source: https://core.blink.new/openapi.json API endpoint for GET /api/rag/{project_id}/collections/{collection_id} ```markdown ### Parameters - **project_id** (string, path, required) - **collection_id** (string, path, required) ### Responses #### 200 - Collection details Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 404 - Collection not found Collection not found ### Example Usage ```bash curl -X GET "https://core.blink.new/api/rag/{project_id}/collections/{collection_id}" ``` ``` -------------------------------- ### GET /api/ai/models Source: https://core.blink.new/openapi.json Returns available AI models from the gateway. Deprecated — use `GET /api/v1/ai/models` for an OpenAI-compatible response. ```markdown ### Responses #### 200 - List of available models - **models** (array (object)) Array items: - **id** (string) (example: "anthropic/claude-sonnet-4.6") - **name** (string) (example: "anthropic/claude-sonnet-4.6") - **description** (string) - **type** (string) (example: "language") - **pricing** (object) - **total** (integer) (example: 260) - **timestamp** (string (date-time)) #### 502 - AI Gateway unavailable **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X GET "https://core.blink.new/api/ai/models" ``` ``` -------------------------------- ### POST /api/data/{project_id}/search Source: https://core.blink.new/openapi.json **🔍 Web Search** Execute a web search and receive structured, provider-agnostic results. Powered by the Value SERP API with provider-specific metadata stripped out. **📋 Result Types** - `organic_results` — Main search results (always included) - `total_results` — Total number of results found - `related_searches` — Related search query suggestions - `people_also_ask` — PAA questions with snippets and source links - `local_results` — Local business results (when location is set or detected) - `ads` — Paid advertisement entries (when present) - `shopping_results` — Shopping results (when available) - `news_results` — News articles (when `tbm=nws` or news is detected) - `image_results` — Image results (when `tbm=isch`) **🌍 Search Types via `tbm`** - *(omit)* — Standard web search (default) - `nws` — News search - `isch` — Image search - `vid` — Video search - `shop` — Shopping search ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **q** (string) (required): Search query (required) (example: "chatgpt") - **location** (string): Geographic location in Value SERP format (example: "San Francisco,CA,United States") - **hl** (string): Language code (2 characters) (example: "en") - **tbm** (string (nws|isch|vid|shop)): Search type: nws=news, isch=images, vid=videos, shop=shopping (example: "nws") ("nws"|"isch"|"vid"|"shop") - **num** (integer): Number of results (let API handle default if not specified) (example: 10) ### Responses #### 200 - Search completed successfully **SearchResponse** - **organic_results** (array (object)): Main search results (always included) Array items: - **position** (integer): Result position in search results - **title** (string): Result title - **link** (string (uri)): Result URL - **snippet** (string): Result description/snippet - **total_results** (string): Total number of results found (example: "About 45,600,000 results") - **related_searches** (array (string)): Related search suggestions (example: ["chatgpt login","chatgpt plus"]) - **people_also_ask** (array (object)): People Also Ask section (when available) Array items: - **question** (string): Question text - **snippet** (string): Answer snippet - **link** (string (uri)): Source URL - **local_results** (array (object)): Local business results (when location specified or detected) Array items: - **title** (string): Business name - **address** (string): Business address - **rating** (number): Star rating - **reviews** (integer): Number of reviews - **phone** (string): Phone number - **ads** (array (object)): Paid advertisements (when present) Array items: - **title** (string): Ad title - **link** (string (uri)): Ad URL - **snippet** (string): Ad description - **shopping_results** (array (object)): Shopping results (when available) Array items: - **title** (string): Product title - **price** (string): Product price - **source** (string): Store/source name - **link** (string (uri)): Product URL - **news_results** (array (object)): News results (when tbm=nws or news detected) Array items: - **title** (string): News article title - **link** (string (uri)): Article URL - **snippet** (string): Article snippet - **date** (string): Publication date - **source** (string): News source - **image_results** (array (object)): Image results (when tbm=isch) Array items: - **title** (string): Image title/alt text - **link** (string (uri)): Source page URL - **original** (string (uri)): Original image URL - **thumbnail** (string (uri)): Thumbnail image URL #### 400 - Invalid request — missing query or invalid project ID **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") #### 405 - Method not allowed — only POST is supported - **error** (string) (example: "Method not allowed") #### 500 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/data/{project_id}/search" \ -H "Content-Type: application/json" \ -d '{ "q": "chatgpt", "location": "San Francisco,CA,United States", "hl": "en", "tbm": "nws", "num": 10 }' ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/host Source: https://core.blink.new/openapi.json API endpoint for POST /api/sandbox/{project_id}/host ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **sandbox_id** (string) (required) - **port** (number) (required) ### Responses #### 200 - Host URL returned Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/host" \ -H "Content-Type: application/json" \ -d '{ "sandbox_id": "string", "port": "0" }' ``` ``` -------------------------------- ### GET /health Source: https://core.blink.new/openapi.json Returns the health status of the API ```markdown ### Responses #### 200 - API is healthy - **message** (string) (example: "healthy") - **timestamp** (string (date-time)) - **status** (string) (example: "healthy") ### Example Usage ```bash curl -X GET "https://core.blink.new/health" ``` ``` -------------------------------- ### POST /api/sandbox/{project_id}/files/read Source: https://core.blink.new/openapi.json API endpoint for POST /api/sandbox/{project_id}/files/read ```markdown ### Parameters - **project_id** (string, path, required): Unique identifier for the project (example: "my-project-123") ### Request Body **Content-Type:** application/json - **sandbox_id** (string) (required) - **path** (string) (required) - **offset** (number) - **limit** (number) ### Responses #### 200 - File content Empty response body #### 401 - response **ErrorResponse** - **error** (string) (required): Human-readable error message (example: "Invalid API key") ### Example Usage ```bash curl -X POST "https://core.blink.new/api/sandbox/{project_id}/files/read" \ -H "Content-Type: application/json" \ -d '{ "sandbox_id": "string", "path": "string", "offset": "0", "limit": "0" }' ``` ```