Developer Docs

Stremit API Setup Guide

Connect your Stremit API key to Enclo or any app to unlock AI-powered analysis, semantic search, and the full tools directory.

Base URL stremit.io/api/v1
Auth Bearer token
Default rate limit 60 req/min
Getting Started

Setup — Step 1 of 2

Get your API key

2

Click Reveal then Copy to copy your key to the clipboard. It looks like: stremit-sk-xxxxxxxx...

3

Keep it private — anyone with this key can make API calls that spend your token balance.

Setup — Step 2 of 2

Connect to Enclo

1

Open Enclo on your device.

2

Go to Settings → Stremit API Key.

3

Paste your key and tap Verify & Save. Enclo will call /api/v1/auth/verify to confirm the key is valid before saving.

4

Once connected, Enclo uses your key automatically for: auto-tagging saved content, AI summarization, and deep semantic search.

API Reference

Reference

Authentication

Every request must include your key in the Authorization header. Optionally pass X-App-Name, X-Device-Type, and X-Device-Name to identify the calling app and device — they populate the Connected Apps list in your API Key tab.

# Required on every request
Authorization: Bearer stremit-sk-your-key-here
X-App-Name:     Enclo   # optional — shows in Connected Apps
X-Device-Type:  windows  # optional — android|ios|windows|mac|linux|web
X-Device-Name:  My Desktop  # optional — friendly device label

Reference

Available endpoints

Base URL: https://stremit.io/api/v1

Account

GET
/auth/verify
Verify your key and return usage stats. Call this on settings save.
GET
/usage
Your token balance and usage: tokens_used, tokens_remaining, tokens_monthly_cap, tokens_topup, and the monthly reset date. Also includes legacy call counters.

Models

GET
/models
List all Claude, GPT, and Kimi models available through your key, with per-million-token pricing and max output limits.
POST
/completions
Unified completion endpoint — pick any model from GET /models. Accepts model, messages (or prompt), optional system, max_tokens (≤4000), temperature. Returns { model, content, usage }. Token usage is counted against your Stremit balance. 30 req/min.

Media Generation

POST
/images/generate
Text-to-image via gpt-image-2. Accepts prompt, optional size (1024x1024 · 1536x1024 · 1024x1536). Returns { image_b64, media_type, tokens_charged }. Billed per image against your token balance. Renders take ~40-60s — use a generous timeout. 5 req/min.
POST
/audio/speech
Text-to-speech via gpt-4o-mini-tts. Accepts text (≤4000 chars), optional voice (alloy · nova · onyx · sage…), instructions (delivery style), format (mp3 · wav · opus · aac). Returns { audio_b64, media_type, tokens_charged }. Billed per character against your token balance. 10 req/min.

AI Features

POST
/chat
AI auto-reply for messaging. Accepts peer_name, messages, persona. Returns { reply }. 60 req/min.
POST
/analyze
Analyze any content — returns title, summary, tags, key points, content type. 60 req/min.
POST
/tone
Rewrite a message in a different tone. Accepts text, tone (casual, formal, friendly…). Returns { result }. 60 req/min.
POST
/translate
Translate a message to any target language. Accepts text, target_language. Returns { result }. 60 req/min.
POST
/os/parse
Convert a natural-language instruction into structured OS commands for Enclo Device Control. Accepts instruction, optional host_name, width, height, known_apps, and an optional image (base64 JPEG of the active monitor — lets the model see the screen, target on-screen elements by pixel, and answer questions about what's displayed; adds vision tokens). Returns { commands, answer, clarification } — answer is set when the user asks about the screen rather than requesting an action. 60 req/min.
POST
/phone/act
Picks the next on-device action for Enclo's Android control agent. Accepts goal, optional package, history, elements (the foreground app's accessibility tree). Returns { action, app, index, text, direction, confirm, reason, summary } — one action at a time (open, tap, type, scroll, back, home, wait, done). 60 req/min.
POST
/search/semantic
Rerank a list of items by relevance to a search query. Powers Enclo Deep Search. 30 req/min.

Tools Directory

GET
/tools
Paginated AI tools directory. Supports category, sort, page.
GET
/tools/trending  /tools/new
Top 20 tools by popularity or recency.
GET
/tools/search?q=
Full-text search across tool names, descriptions, and categories.
GET
/tools/<id>
Full tool profile by ID.
GET
/categories
All tool categories with counts.

Stacks

GET
/stacks
Paginated public stacks (originals only, no clones). Supports sort (trending · newest · popular), page, per_page.
GET
/stacks/trending
Top 20 original public stacks by like count.
GET
/stacks/<id>
Full stack profile with all items (tool, position, use_case, step_order). Returns 404 for cloned stacks.

Strems

GET
/strems
Paginated AI agents directory (original strems only, no forks). Supports sort (trending · newest · top_rated), type (prompt · workflow · agent), category.
GET
/strems/<id>
Full strem detail including content and variables schema. Returns 404 for forks. Increments use count.
POST
/strems
Create a new strem (AI agent). Accepts name, content, agent_type (prompt · workflow · agent), optional tagline, description, category, variables_schema. Pass ai_generate: true with a description to have Claude write the prompt — token usage is counted against your key. Returns { strem }. 10 req/min.
POST
/strems/<id>/run
Execute a strem with variable substitution. Accepts variables: {key: value}. Token usage is counted against your key. Returns { result, tokens_used, model }. 30 req/min.

Vision

POST
/vision/describe
Describe the contents of an image. Accepts image (base64), media_type (jpeg · png · webp · gif), optional focus hint. Returns { description }. 30 req/min.
POST
/vision/extract
Extract structured data or text from an image. Accepts image (base64), mode (text · table · form · json), optional schema for json mode. Returns { result }. 30 req/min.

Reference

Quick example

Verify your key with a single curl call:

# curl
curl https://stremit.io/api/v1/auth/verify \
  -H "Authorization: Bearer stremit-sk-your-key-here" \
  -H "X-App-Name: MyApp"
# Python
import requests

headers = {
    'Authorization': 'Bearer stremit-sk-your-key-here',
    'X-App-Name':     'MyApp',
}
res = requests.get('https://stremit.io/api/v1/auth/verify', headers=headers)
print(res.json())
// JavaScript
const res = await fetch('https://stremit.io/api/v1/auth/verify', {
  headers: {
    'Authorization': 'Bearer stremit-sk-your-key-here',
    'X-App-Name':     'MyApp',
  },
});
const data = await res.json();
console.log(data);

Reference

Using the models

Your Stremit key gives you direct access to Claude, GPT, and Kimi models through one endpoint. The flow is simple: pick a model from GET /models, send your conversation to POST /completions, and the token usage is deducted from your Stremit balance — the same balance the in-app AI features use.

Available models: claude-sonnet-5 · claude-opus-4-8 · claude-haiku-4-5-20251001 · gpt-5 · gpt-5-mini · kimi-k2.6 · kimi-k2.5

# curl — simplest form: just a prompt
curl https://stremit.io/api/v1/completions \
  -H "Authorization: Bearer stremit-sk-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "prompt": "Explain what a REST API is in one paragraph.",
    "max_tokens": 500
  }'
# Python — multi-turn conversation with a system prompt
import requests

res = requests.post(
    'https://stremit.io/api/v1/completions',
    headers={'Authorization': 'Bearer stremit-sk-your-key-here'},
    json={
        'model': 'kimi-k2.6',
        'system': 'You are a concise technical writer.',
        'messages': [
            {'role': 'user', 'content': 'Write a haiku about databases.'},
        ],
        'max_tokens': 200,
        'temperature': 0.8,
    },
)
data = res.json()
print(data['content'])
print(data['usage'])  # {'input_tokens': ..., 'output_tokens': ..., 'total_tokens': ...}
// JavaScript — passing prior turns for context
const res = await fetch('https://stremit.io/api/v1/completions', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer stremit-sk-your-key-here',
    'Content-Type':  'application/json',
  },
  body: JSON.stringify({
    model: 'claude-haiku-4-5-20251001',
    messages: [
      { role: 'user', content: 'Suggest 3 names for a coffee shop app.' },
      { role: 'assistant', content: 'BrewMate, SipSpot, DailyDrip' },
      { role: 'user', content: 'More playful, please.' },
    ],
    max_tokens: 300,
  }),
});
const data = await res.json();
console.log(data.content);
# Response shape (all languages)
{
  "model": "claude-sonnet-5",
  "content": "A REST API is...",
  "usage": {
    "input_tokens": 18,
    "output_tokens": 112,
    "total_tokens": 130
  }
}

Text to image & text to audio

The same key also generates media. Both endpoints return base64 you decode and save — images are billed per image, audio per character, all against the same token balance.

# Python — text to image (renders take ~40-60s, use a long timeout)
import requests, base64

res = requests.post(
    'https://stremit.io/api/v1/images/generate',
    headers={'Authorization': 'Bearer stremit-sk-your-key-here'},
    json={
        'prompt': 'A cozy coffee shop at sunset, watercolor style',
        'size': '1536x1024',
    },
    timeout=120,
)
with open('image.png', 'wb') as f:
    f.write(base64.b64decode(res.json()['image_b64']))
# Python — text to speech
import requests, base64

res = requests.post(
    'https://stremit.io/api/v1/audio/speech',
    headers={'Authorization': 'Bearer stremit-sk-your-key-here'},
    json={
        'text': 'Welcome to Stremit — your AI toolkit.',
        'voice': 'nova',
        'instructions': 'Speak like an upbeat product narrator.',
    },
)
with open('speech.mp3', 'wb') as f:
    f.write(base64.b64decode(res.json()['audio_b64']))
# curl — text to image, decode straight to a file
curl -s --max-time 120 https://stremit.io/api/v1/images/generate \
  -H "Authorization: Bearer stremit-sk-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A minimalist rocket logo, flat design", "size": "1024x1024"}' \
  | jq -r '.image_b64' | base64 -d > image.png
// JavaScript — text to speech, played directly in the browser
const res = await fetch('https://stremit.io/api/v1/audio/speech', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer stremit-sk-your-key-here',
    'Content-Type':  'application/json',
  },
  body: JSON.stringify({
    text: 'Your order has shipped and arrives tomorrow.',
    voice: 'sage',
    format: 'mp3',
  }),
});
const { audio_b64, media_type } = await res.json();

// Turn the base64 into a playable Audio object
const bytes = Uint8Array.from(atob(audio_b64), c => c.charCodeAt(0));
const url = URL.createObjectURL(new Blob([bytes], { type: media_type }));
new Audio(url).play();

If your token balance runs out you'll get a 402 with an explanation — top up or wait for your monthly reset. Requests are capped at max_tokens: 4000 and 30 req/min. Note: GPT-5 models use their default temperature — a custom temperature value is ignored for them.

Reference

Limits & error responses

Token budget

Shares your Pro plan's monthly token allowance — see Tokens Used in your API Key tab.

Rate limits

Most endpoints: 60 req/min  ·  /completions, /search/semantic, /vision/*: 30 req/min  ·  POST /strems, /audio/speech: 10 req/min  ·  /images/generate: 5 req/min

401 Missing or invalid key, deactivated key, or expired Pro subscription.
402 Token balance exhausted — purchase a top-up or wait for your monthly reset.
429 Rate limit exceeded (per-minute) or monthly call limit reached.
503 AI service temporarily unavailable — retry with exponential backoff.

Need help or have a question about the API?

Contact support →

Clone this stack?

A copy will be added to your library