Installation
Install the official SDK to get started quickly.
npm install tidal-ai
yarn add tidal-ai
pnpm add tidal-ai
Quickstart
Create a client and make your first request.
import { Tidal } from 'tidal-ai'
const tidal = new Tidal({ apiKey: process.env.TIDAL_API_KEY })
const sentiment = await tidal.analyze({
text: 'Tidal is delightful',
type: 'sentiment'
})
console.log(sentiment)
Configuration
Most apps only need an API key. Advanced options let you tune retries, timeouts, models, and logging.
const tidal = new Tidal({
apiKey: process.env.TIDAL_API_KEY,
timeout: 30_000,
retries: 3,
models: ['gpt-4', 'stable-diffusion'],
logging: true
})
Core concepts
Components
The SDK unifies NLP, vision, and inference behind a consistent interface.
- NLP: text analysis and generation
- Vision: image and video understanding
- Inference: uniform model invocation
Requests
Requests accept a structured input object and return a typed result.
{
"input": { "text": "Hello", "options": { "language": "en" } },
"config": { "timeout": 30000, "version": "v1" }
}
Error handling
try {
const res = await tidal.process(input)
} catch (err) {
if (err instanceof TidalValidationError) {
// handle validation
} else if (err instanceof TidalAPIError) {
// handle API errors
}
}
Endpoints
Core REST endpoints exposed by the service.
POST /api/v1/analyze/text
POST /api/v1/vision/detect
GET /api/v1/models
Request/Response
{
"status": "success",
"data": { "result": {}, "metadata": {} },
"timing": { "duration_ms": 127 }
}
Rate limits
Back off and retry on 429 using the reset header for best results.
React
import { useTidal } from '@tidal/react'
function Chat() {
const { analyze } = useTidal()
// ...
}
Vue
import { createTidal } from '@tidal/vue'
export default { setup() { const tidal = createTidal() } }
Cloud
Deploy on AWS, GCP, or Azure with a unified configuration model.
Security
Store API keys in env vars; enable encryption when handling PII.
Performance
Use batch requests and caching to minimize latency and costs.
Advanced configuration
Fine-tune behavior with middleware, distributed processing, and custom error handling.
tidal.use(async (req, next) => {
const res = await next(req)
// post processing
return res
})
Monitoring
Emit metrics and traces to your preferred observability stack.
monitoring.log({
name: 'tidal.request',
durationMs: 42,
status: 'ok'
})
Deployment
Package, release, and scale across environments.
- Use canary deployments for risky changes
- Pin API versions for safety
- Automate rollbacks on health check failures
FAQ
Is there a free tier?
Yes, see pricing for current limits.
What SDKs are supported?
JavaScript/TypeScript officially; community ports exist for others.