← Home

API Reference

ContextTube API v1 — Structured context for AI

Authentication

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.

POST/api/v1/keysPublic

Register for an API key.

Request

{
  "name": "My AI App",
  "email": "optional@example.com"
}

Response (201)

{
  "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."
}
GET/api/v1/contentPublic

Browse all content. Supports ?channel=, ?tag=, ?domain=, ?limit=, ?offset= query params.

Response

{
  "content": [
    {
      "id": "cu_001",
      "title": "Кибернетика Шеннона",
      "channel_name": "navrotskiy",
      "chunk_count": 10,
      "total_tokens": 5200,
      "tags": ["cybernetics", "information"],
      "domains": ["science", "philosophy"]
    }
  ]
}
GET/api/v1/content/{id}🔑 Auth required

Get content details with layer statistics.

GET/api/v1/content/{id}/layer/{layer}🔑 Auth required

Get all chunks for a specific layer (1-5).

⚠️ Layer 1 is free. Layers 2-5 require an API key.
GET/api/v1/channelsPublic

List all channels with content counts.

POST/api/v1/assemble🔑 Auth required

Assemble optimized context from a content unit. This is the core endpoint — it selects the best chunks for your token budget.

Request

{
  "contentId": "cu_001",
  "strategy": "relevant",
  "maxTokens": 4000,
  "maxLayer": 3,
  "focus": ["consciousness", "feedback"],
  "noAds": false
}

Parameters

  • 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 prioritize
  • chunkIds — specific chunk IDs (for "custom" strategy)
  • noAds — true to skip sponsored chunks (paid tiers)

Response

{
  "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"
    }
  }
}
GET/api/v1/usage🔑 Auth required

View your API usage and remaining budget.

Response

{
  "name": "My AI App",
  "tier": "free",
  "today": {
    "tokensUsed": 3847,
    "tokensRemaining": 6153,
    "dailyLimit": 10000
  },
  "allTime": {
    "totalTokens": 58320,
    "totalRequests": 15
  }
}

Pricing Tiers

Free $0
10K tokens/day
  • Layer 1 free (no key)
  • Sponsored chunks in assemblies
  • Great for exploration
Builder $29/mo
500K tokens/day
  • No ads (noAds option)
  • All 5 layers
  • Priority support
Scale $199/mo
5M tokens/day
  • High volume access
  • Webhook notifications
  • SLA guarantee
Enterprise Custom
Unlimited
  • Custom integrations
  • Dedicated support
  • On-premise option

Free vs Paid Assemblies

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.