Developer API · v1
TINS HUB API
Generate trend ideas, poll job status, and adapt briefs for additional platforms — all with a singletp_ API key.
Authentication
All requests require an API key in the Authorization header. Keys are Power tier only and can be created from Settings → API Access. You can have up to 5 active keys at a time.
Authorization: Bearer tp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxBase URL
https://api.tinshub.com/api/v1/api/v1 is stable. Breaking changes will ship under/api/v2 with at least 90 days notice.
API status
- Deployed
- just now71978c6
- Rate limits
- 100/min per IP · 30/min per user
Live values from GET /api/v1/status. Cached 60s.
Endpoints
/api/v1/statusPublic health check. Returns current rate limits, the latest deploy timestamp, and a short commit SHA. No auth required, cached 60s.
curl https://api.tinshub.com/api/v1/statusResponse (200)
{
"status": "ok",
"version": "v1",
"deployedAt": "2026-04-27T15:42:11.000Z",
"commitSha": "abc1234",
"rateLimits": {
"perIpPerMinute": 100,
"perUserPerMinute": 30
}
}/api/v1/trendsKick off a trend-brief generation job. Costs 1 credit (refunded if the pipeline returns no usable trends). Returns immediately with a jobId you can poll.
curl -X POST https://api.tinshub.com/api/v1/trends \
-H "Authorization: Bearer tp_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"niche": "indie game dev",
"platform": "TikTok",
"audience": "solo developers",
"style": "educational",
"geography": "global",
"format": "Short video"
}'Response (202)
// 202 Accepted — generation started
{
"jobId": "8f3a2c0e-9b1d-4e7a-9f31-1c2d4e5f6a7b",
"statusUrl": "/api/v1/trends/status?jobId=8f3a2c0e-..."
}/api/v1/trends/status?jobId=...Poll a job. Returns partial briefs as they stream in, plus the final result once status is `completed`. Does not spend credits.
curl https://api.tinshub.com/api/v1/trends/status?jobId=JOB_ID \
-H "Authorization: Bearer tp_YOUR_KEY"Response (200, completed)
// 200 OK — poll until status === "completed"
{
"jobId": "8f3a2c0e-...",
"status": "completed",
"step": "done",
"stepMessage": "Complete",
"partialBriefs": [/* same shape as result.trends, streamed */],
"result": {
"trends": [
{
"id": "trend-abc123",
"name": "Solo dev devlogs",
"momentum": 72,
"region": "global",
"whyRising": "Indie launches surging on TikTok",
"fitScore": 85,
"decision": "post_now",
"angle": "Why your devlog needs a 'mistake of the week'",
"hooks": [
"I almost shipped a game-breaking bug. Here's how I caught it.",
"Your devlog is boring. Here's the fix.",
"3 mistakes every solo dev makes in their first devlog"
],
"outline": {
"talkingPoints": ["Hook with a specific mistake", "Show the bug visually", "Explain the root cause", "Lesson learned"],
"cta": "Drop your worst dev mistake below.",
"caption": "Devlogs hit different when you're honest. #indiedev #gamedev"
},
"format": "Short video",
"confidence": "high"
}
]
}
}/api/v1/trends/historyList your recent generation jobs (up to 50). Useful for resuming flows or building dashboards.
curl "https://api.tinshub.com/api/v1/trends/history?limit=10" \
-H "Authorization: Bearer tp_YOUR_KEY"/api/v1/adaptRe-generate a previously-returned trend for additional platforms. Pass the source jobId + the trend's id (from result.trends[].id). Costs 0.5 credits per target platform (rounded up).
curl -X POST https://api.tinshub.com/api/v1/adapt \
-H "Authorization: Bearer tp_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"jobId": "8f3a2c0e-...",
"trendId": "trend-abc123",
"targetPlatforms": ["X", "Reddit", "YouTube"]
}'Response (200)
// 200 OK
{
"sourceJobId": "8f3a2c0e-...",
"sourceTrendId": "trend-abc123",
"creditsSpent": 2,
"adaptations": [
{ "platform": "X", "trend": { "id": "adapt-x-...", "angle": "...", "hooks": [...], "outline": {...}, "format": "Thread" } },
{ "platform": "Reddit", "trend": { "id": "adapt-reddit-...", "angle": "...", "hooks": [...], "outline": {...}, "format": "Text post" } }
]
}Rate limits
- · 100 requests / minute per IP
- · 30 requests / minute per user
- · Exceeded limits return
429 Too Many Requests
CORS & browser usage
All /api/v1/* endpoints accept browser requests from any origin by default (Access-Control-Allow-Origin: *). Auth is bearer-token only, so we never set Allow-Credentials.
For tighter security, restrict each key to specific origins from Settings → API Access. When an allow-list is set, the API only returns CORS headers for matching origins — browsers will block unauthorized sites. Note: origin restrictions are advisory; they don't prevent server-side reuse of a leaked key. Treat keys like passwords.
Error format
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Not enough credits."
}
}| Status | Code | Meaning |
|---|---|---|
| 401 | AUTH_ERROR | Missing or invalid API key |
| 402 | INSUFFICIENT_CREDITS | Buy more credits or upgrade your plan |
| 403 | FORBIDDEN | Your tier does not have access to this endpoint |
| 404 | NOT_FOUND | Job or trend not found |
| 409 | VALIDATION_ERROR | Job not yet completed (for adapt) |
| 400 | VALIDATION_ERROR | Request body is malformed |
| 429 | RATE_LIMITED | Slow down — see retry-after header |
| 5xx | INTERNAL_ERROR | Try again with exponential backoff |
Versioning
/api/v1 is the stable contract. Additive changes (new optional fields, new endpoints) ship under v1 without notice. Breaking changes will ship under/api/v2 with at least 90 days of overlap and a deprecation header on v1 responses. Check GET /api/v1/status for the current deploy.