Thinking Ads
A video card can appear in Telegram while a response is being generated. The intro transitions into the ad. Buttons and attribution appear immediately by default. With the thinking format, they are added together once the video reaches the ad.
Both endpoints accept JSON. The API key is passed in the header Authorization: Bearer <SIDEKICK_API_KEY>.
The header (“Бот думает” by default) and the intro can be changed per Telegram platform in the dashboard: Platforms → platform → Thinking Ads. The same section sets the premium emoji before the header (the loading emoji by default), a custom intro (GIF or video) and how long it plays before the ad: 1–10 seconds, 5 by default. A short animation loops, a longer one is cut.
Card request
POST /api/v1/ad/thinking
| Field | Type | Required | Description |
|---|---|---|---|
platform_id | string | Yes | Public ID of the Telegram platform in Sidekick. |
user_id | number | Yes | Telegram ID of the user who started generation. |
language_code | string | Yes | User's language code. |
accept_formats | string[] | No | Use thinking for a separate reveal. With card or when omitted, buttons appear on send. With rich_messages: false no card is returned. |
user_message | string | Recommended | The user's request the bot is answering now. Used to pick the ad; without it topic targeting cannot match. |
capabilities.custom_emoji | boolean | No | true if the bot owner has Telegram Premium: the header gets an animated loading emoji. |
group_id | number | No | Group ID when generating in a group. With bot_is_admin: true the card is sent ephemerally. |
Request at most one card per generation. If the response is lost, generation continues without a retry. Telegram parameters
{"platform_id": "plt_example","user_id": 123,"language_code": "ru","accept_formats": ["thinking"]}
Card response
When has_ad: false, there is no card and nothing else to call. When has_ad: true:
| Field | Description |
|---|---|
impression_id | Placement ID for the finish request. |
ad.send | Initial Telegram payload: header and video. In the thinking format, without buttons and attribution. |
ad.reveal | Edit payload that adds buttons to the same message. Omitted for single-step cards. |
ad.reveal_after_ms | Milliseconds after sending the card to apply reveal: by then the video already shows the ad. |
ad.media | The card's video: id (stable for an intro + creative pair), url, duration_ms, ad_starts_ms (the crossfade to the ad starts) and ad_visible_ms (the ad fills the frame). |
ad.finish_within_ms | Completion window in milliseconds from issuance. |
ad.button_text, ad.button_url | Primary button label and URL. |
The placement status is required when generation ends. For a two-step card, ad.reveal applies ad.reveal_after_ms after sending while generation is in progress.
Billing
Only the time the ad was on screen is paid: from card issuance to the first accepted finish, minus the intro (ad.media.ad_visible_ms).
| Ad time | Paid |
|---|---|
| under 2 seconds | nothing |
| 2 to 30 seconds | linear: (time − 2 s) / 28 s of the impression price |
| 30 seconds or more | one full impression, never more |
not_sent | nothing |
| finish after ad.finish_within_ms (4 minutes) | nothing |
A shorter intro leaves more time for the ad.
Statistics
Thinking Ads impressions, clicks and earnings are reported separately in the thinking block of GET /api/v1/earnings (in total and each day) and are already included in the overall figures. A paid card counts as one whole impression; unpaid cards are not counted. Earnings appear after the first accepted finish and are recorded at the card's issuance time, so the last ~10 minutes of Thinking data are incomplete. Days are UTC. Compute fill from your own /api/v1/ad/thinking calls: requests without an ad are not in the report.
Placement completion
POST /api/v1/ad/thinking/finish
The request requires the impression_id from the card response and the placement status.
| status | Meaning |
|---|---|
removed | Removal of the sent card was confirmed. |
not_sent | The card was not sent. |
unknown | Sending or removal could not be confirmed. The status can be updated later. |
Success returns 204 No Content. Retrying with the same ID and status is safe.
Errors
| Status | Meaning |
|---|---|
400 | Invalid request parameters. |
401 | Missing or invalid key. |
404 | The placement is unavailable with this API key or does not exist. |
409 | A different final status has already been accepted. |
503 | The same finish request can be retried after the delay specified in Retry-After. |