Overview
createTinybirdApi() creates a low-level API wrapper that provides direct access to Tinybird’s REST API. This is a standalone alternative to the typed TinybirdClient that requires only a baseUrl and token.
Use this when you:
- Want a simple API client without type definitions
- Need dynamic access without compile-time schemas
- Are building scripts, CLI tools, or integrations
- Don’t want to define datasources and pipes in TypeScript
Signature
Parameters
Configuration object with the following properties:
Return Value
Returns aTinybirdApi instance with methods for querying, ingesting, and managing data.
Example
Basic Usage
Ingest Data
Manage Datasource Data
Execute Raw SQL
Custom Fetch Implementation
Per-Request Token Override
Configuration Options
Base URL by Region
Tinybird operates in multiple regions. Use the appropriate base URL for your workspace:| Region | Base URL |
|---|---|
| EU (default) | https://api.tinybird.co |
| US East | https://api.us-east.tinybird.co |
Token Types
Different token types grant different levels of access:| Token Type | Prefix | Capabilities |
|---|---|---|
| Admin | p. | Full access: read, write, manage resources |
| Read | p. | Query endpoints only |
| Append | p. | Ingest data into datasources only |
| JWT | eyJ | Scoped, time-limited access with fixed parameters |
Custom Timeouts
Set a default timeout for all requests, or override per-request:Alias
createTinybirdApiWrapper() is an alias for teams that prefer “wrapper” naming:
When to Use This vs. Tinybird Client
Use createTinybirdApi() when:
- Building scripts, CLI tools, or automation
- You don’t want to define schemas in TypeScript
- Working with dynamic datasources/pipes
- Prototyping or exploring the API
- Integrating into non-TypeScript projects
Use Tinybird client when:
- You want full type safety and autocomplete
- Working in a TypeScript application
- Managing datasources and pipes as code
- Need compile-time validation of queries and ingestion
- Want to leverage the full SDK tooling (
tinybird dev,tinybird deploy, etc.)
Error Handling
All API methods throwTinybirdApiError on failure:
Related
TinybirdApi
Full API reference for the TinybirdApi class
Tinybird Client
Type-safe client with schema definitions