API and clients
API key authentication on the Enterprise plan: scopes, rate limits, the OpenAPI reference, Python and JavaScript clients, and connecting with the MCP SDKs.
Quick start
Create a key under Settings › API in the panel and send it with every request in the Authorization header.
curl https://tecrube.com/api/v1/account/me \
-H "Authorization: Bearer tk_your_key"Authentication and scopes
- A key starts with
tk_and is shown only once, when it is created; only its hash is stored. - A key can't exceed the authority of the person who created it. If that person leaves the team the key stops working; if their role drops, a write key falls back to read.
- If the plan loses API access, requests return 402. An account can have at most 20 active keys.
| Scope | Can | Can't |
|---|---|---|
| read | Read all data | Change anything or start work |
| write | Act as a workspace admin; changes follow your approval rules | Team, password, session, 2FA, plan and payment actions |
Rate limits
- API: 600 requests per minute per key.
- MCP tools: 120 calls per minute per key and 2,000 calls per hour per account.
- Over the limit you get 429 with a
Retry-Afterheader. The ready-made clients retry reads and 429 by themselves.
Error codes
| Code | Meaning |
|---|---|
| 401 | Key missing, invalid or revoked |
| 402 | The plan doesn't include this action |
| 403 | Scope or role isn't sufficient |
| 404 | Record not found |
| 422 | Invalid body or parameter |
| 429 | Rate limit exceeded |
| 5xx | Temporary server problem; retry read requests |
OpenAPI reference
Download the current OpenAPI document of every endpoint your key can reach. Import it into Postman, or generate clients for other languages with openapi-generator.
curl https://tecrube.com/api/v1/api-referansi/openapi.json \
-H "Authorization: Bearer tk_your_key" \
-o tecrube-openapi.jsonReady-made clients
No dependencies: install the package, or drop the single file into your project and import it. Includes REST, MCP tools, retries and an error type.
pip install tecrubenpm install tecrube- Download: tecrube.py (Python 3.9+)
- Download: tecrube.mjs · tecrube.d.ts (Node 18+, Deno, Bun)
from tecrube import Tecrube, TecrubeError
client = Tecrube("tk_your_key")
me = client.get("/account/me")
campaigns = client.call_tool("list_campaigns", days=7)
try:
client.post("/account/brands", {"name": "New project"})
except TecrubeError as e:
print(e.status, e.message)import { Tecrube, TecrubeError } from "tecrube";
const client = new Tecrube(process.env.TECRUBE_API_KEY);
const me = await client.get("/account/me");
const campaigns = await client.callTool("list_campaigns", { days: 7 });
try {
await client.post("/account/brands", { name: "New project" });
} catch (e) {
if (e instanceof TecrubeError) console.error(e.status, e.message);
}Connecting with the MCP SDKs
The official MCP SDKs (TypeScript and Python) connect to this URL. If you're building your own assistant or agent, send the key in the header; apps acting for other users use OAuth 2.1.
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const transport = new StreamableHTTPClientTransport(new URL("https://tecrube.com/mcp"), {
requestInit: { headers: { Authorization: `Bearer ${process.env.TECRUBE_API_KEY}` } },
});
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(transport);
const { tools } = await client.listTools();Mobile app SDK
Tecrube has no SDK to embed in your mobile app, and you don't need one. For in-app measurement you install Google Analytics for Firebase, the Meta SDK and the TikTok SDK directly; Tecrube reads their data through your accounts.
Next steps
- How it worksThe journey of a chat message through Tecrube to the ad platform and safely back: MCP, OAuth, guardrails, approval of suggestions, audit log and undo.
- Security & ApprovalTecrube's security model: OAuth 2.1, changes applied on your request and undoable, approval for suggestions, budget guardrail, audit log and results the assistant cannot invent.
- PlansThe Starter, Professional, Agency and Enterprise tiers: monthly and yearly prices, credit allowances, add-on packages, the referral programme and the rules for changing plans.