AI
These endpoints power LinkLane's AI features in the app. They all need a dashboard session, so an API key gets 401. This page lists what each one does and what it costs, so you can predict credit use.
Credits and errors
Each call that asks the model for something new spends AI credits. Reading a cached answer is free. If the model fails and LinkLane falls back to a built-in answer, the credits are refunded.
Paid plans get credits every month. Free gets none, but a Free account can still spend credits it earned through referrals or bought. That is why most endpoints below say "Any plan with AI credits".
| Situation | Response |
|---|---|
| No credits at all (Free, with no earned or bought credits) | 402, detail.error = "ai_requires_paid_plan" |
| Out of credits this month | 402, detail.error = "quota_exceeded", detail.dimension = "ai_credits" |
| More than 20 calls a minute to one AI feature | 429, detail.error = "rate_limited" |
In all three, detail is an object. See Errors.
Insights
Plain-English reads of your analytics. Each returns summary, why (up to 4 reasons), anomalies (up to 3), recommendations (up to 3), the data it used, and generated_by ("ai" or "fallback"). Answers are cached for 6 hours; add ?force=true for a fresh one.
Link and QR insights also return actions: fixes you can apply with Apply an action.
{
"summary": "Clicks rose 38% this week, mostly from Instagram on mobile.",
"why": ["Instagram referrals doubled after the 24 Nov story."],
"anomalies": ["24 Nov was a spike: about 3× a normal day."],
"recommendations": ["Add device routing so iOS visitors land on the app."],
"generated_by": "ai",
"cached": false,
"actions": [
{
"type": "enable_conversion_tracking",
"link_id": "6f1c2b9e-…",
"label": "Turn on conversion tracking",
"feature": "Conversions",
"why": "This link has traffic but isn't measuring outcomes yet.",
"params": {}
}
]
}
A short text summary of one link's traffic: { "summary": "…", "cached": false, "age_hours": 0 }. Cached for 6 hours; takes ?force=true.
Create with AI
Body: url (required), title, description. Returns { "suggestions": ["spring-sale", …] }, up to 5.
Same body. Returns up to 5 tag suggestions.
Turns a sentence into a link setup. Body: goal (3–600 characters, required) and url. Returns alias, utm, tags, campaign_name and a note.
{ "goal": "Summer sale for Instagram, US mobile", "url": "https://shop.example.com/summer" }
Drafts a link-in-bio page. Body: prompt (3–600 characters). Returns profile_name, bio, theme, slug and links.
Reads the last 14 days of a link's traffic and suggests a routing rule. Returns recommendations and the data behind them. Refunded when there's nothing to suggest.
The free preview new accounts see during onboarding. Same body as /api/ai/intent. Built-in rules, no model. Limited to 30 calls an hour.
Agent
The AI Strategist. Body: goal (3–600 characters, required) and an optional link_id. Returns a summary, up to 4 steps (each with title, detail and feature) and actions you can apply.
Apply an action
Applies one fix to a link in your workspace. Needs the member role or higher.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | One of the action types below. |
link_id | string | Yes, for link actions | The link to change. |
params | object | No | Extra input for the action. |
type | What it does | params |
|---|---|---|
enable_conversion_tracking | Turns on conversion tracking. Pro and above. | none |
disable_conversion_tracking | Turns it off. | none |
set_utm | Sets UTM values. | utm: source, medium, campaign, term, content |
restore_link | Undoes a set_utm. | snapshot_id, from the undo that set_utm returned |
{
"ok": true,
"message": "Conversion tracking on for /spring-sale.",
"undo": { "type": "disable_conversion_tracking", "link_id": "6f1c2b9e-…", "params": {} }
}
Send the undo object back to this endpoint to reverse the change. Undoing a set_utm returns 409 if the link was edited since.
Digest and alerts
A summary of your account's week: { "summary": "…", "cached": true }.
Emails you the account digest now. Returns { "sent": true }, or 400 if you opted out of email.
Runs the alert scan now: links that expire within 48 hours, links near their click cap, and busy links with no conversion tracking. New findings become notifications. Returns { "ok": true, "new_alerts": 2 }.
Bring your own key
Sends your AI calls to your own OpenRouter key. Calls still spend credits from your monthly allotment. Body: api_key (required), model, provider (only "openrouter"). The key is encrypted at rest and never returned.
Shows the setup without the key: configured, enabled, provider, model and key_masked.
Removes your key. AI goes back to credits.