ContextTube API v1 — Structured context for AI
Most endpoints require an API key passed as a Bearer token:
Authorization: Bearer ct_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Free tier: /api/v1/content (list) and Layer 1 are free. Layer 2+ and /assemble require a key.
/api/v1/keysPublicRegister for an API key.
{
"name": "My AI App",
"email": "optional@example.com"
}{
"key": "ct_abc123...",
"name": "My AI App",
"tier": "free",
"dailyTokenLimit": 10000,
"createdAt": "2026-02-16T...",
"message": "Store this key securely — it cannot be retrieved again."
}/api/v1/contentPublicBrowse all content. Supports ?channel=, ?tag=, ?domain=, ?limit=, ?offset= query params.
{
"content": [
{
"id": "cu_001",
"title": "Кибернетика Шеннона",
"channel_name": "navrotskiy",
"chunk_count": 10,
"total_tokens": 5200,
"tags": ["cybernetics", "information"],
"domains": ["science", "philosophy"]
}
]
}/api/v1/content/{id}🔑 Auth requiredGet content details with layer statistics.
/api/v1/content/{id}/layer/{layer}🔑 Auth requiredGet all chunks for a specific layer (1-5).
/api/v1/channelsPublicList all channels with content counts.
/api/v1/assemble🔑 Auth requiredAssemble optimized context from a content unit. This is the core endpoint — it selects the best chunks for your token budget.
{
"contentId": "cu_001",
"strategy": "relevant",
"maxTokens": 4000,
"maxLayer": 3,
"focus": ["consciousness", "feedback"],
"noAds": false
}strategy — "relevant" (default), "complete", or "custom"maxTokens — token budget (default 4000)maxLayer — max depth layer to include (default 3)focus — array of concept strings to prioritizechunkIds — specific chunk IDs (for "custom" strategy)noAds — true to skip sponsored chunks (paid tiers){
"assemblyId": "asm_1708100000000",
"contentId": "cu_001",
"title": "Кибернетика Шеннона",
"strategy": "relevant",
"totalTokens": 3847,
"chunks": [
{
"id": "ad_001",
"layer": 0,
"type": "sponsored",
"text": "Build with Claude — the AI assistant...",
"sponsored": true,
"sponsor": "Anthropic",
"sponsorUrl": "https://anthropic.com"
},
{
"id": "ch_001",
"layer": 1,
"type": "thesis",
"text": "Information is the measure of surprise...",
"tokens": 180,
"importance": 10
}
],
"billing": {
"tokensConsumed": 3847,
"cost": "$0.0385",
"tierRemaining": "6,153 tokens left today (of 10,000)",
"creatorEarnings": {
"channel": "navrotskiy",
"earned": "$0.0269"
}
}
}/api/v1/usage🔑 Auth requiredView your API usage and remaining budget.
{
"name": "My AI App",
"tier": "free",
"today": {
"tokensUsed": 3847,
"tokensRemaining": 6153,
"dailyLimit": 10000
},
"allTime": {
"totalTokens": 58320,
"totalRequests": 15
}
}Free-tier assemblies include one sponsored chunk at the beginning of the chunks array, clearly marked with "sponsored": true. Paid tiers (or "noAds": true) return only content chunks.
Sponsored chunks are contextually relevant — targeted by concept overlap with the content being assembled.