OpenAI + Tevyr
Send prompts to OpenAI's chat models from inside any Tevyr macro — generate a one-line tease for the next session, summarize the previous segment, rewrite a moderator message, classify a Q&A submission. Capture the response in a downstream step and feed it into Slack, Notion, or a message overlay.
OpenAI's API hosts GPT-4o, GPT-4o-mini, GPT-4-turbo, and GPT-3.5-turbo. Tevyr's template targets the /v1/chat/completions endpoint with Authorization: Bearer sk-… auth — exactly the pattern shown in OpenAI's own quickstart. Get an account at platform.openai.com.
What you can do
Generate a live tease for the next session
Mid-show, ask GPT to write a one-line teaser for the upcoming speaker. Capture the response and post it to a stage banner or Slack.
Summarize the previous session
On session end, feed the session metadata to GPT and ask for a tweet-length recap. Post to Slack for the post-show debrief.
Rewrite a moderator message
Operator types a rough message; macro asks GPT to rewrite it in a calmer / more formal tone; result flashes on-stage. Useful for high-tension events.
Classify a Q&A submission
Send each new Q&A to GPT with 'Classify as: technical / opinion / off-topic'. Route by classification — technical to subject-matter slack, off-topic to a holding queue.
Prerequisites
- Tevyr Starter plan or above — Free plan ships 0 integration connections
- OpenAI API account with billing set up — OpenAI no longer offers free credits to new accounts. Each chat completion costs cents per call; budget accordingly
- An API key from platform.openai.com/api-keys
One-time setup
- Visit platform.openai.com/api-keys
- Click Create new secret key, name it
Tevyr, click Create - Copy the key — it starts with
sk-…and is shown only once - In Tevyr, Settings → Integrations → Add new → OpenAI
- Paste the key, name the connection (e.g. "OpenAI — production"), click Save
- Click Test — Tevyr calls
/v1/models(free, read-only) and shows a green toast listing the models your key has access to
Recipes
Drag flow.http_request, pick your OpenAI connection, pick the Chat completion action.
Recipe 1 — Generate a session tease
| Field | Value |
|---|---|
| Model | gpt-4o-mini (fast and cheap; switch to gpt-4o for higher quality) |
| Prompt | Write a one-line teaser for an event session titled "{{ctx.session.name}}". Keep it under 12 words. |
| Temperature | 0.9 (more creative) |
| Max tokens | 60 |
Then chain a Slack send_message and pull the reply via:
{{steps['<openai-step-id>'].output.body.choices[0].message.content}}
Recipe 2 — Summarize and post to Slack
Trigger: lifecycle event on_session_end.
| Field | Value |
|---|---|
| Model | gpt-4o-mini |
| Prompt | Summarize this session in one tweet-length sentence: "{{ctx.session.name}}" (lasted {{ctx.session.duration_seconds}}s). |
| Max tokens | 80 |
Capture and post to #post-show-recap.
Recipe 3 — Classify a Q&A submission
Trigger: on_question_submitted.
| Field | Value |
|---|---|
| Model | gpt-4o-mini |
| Prompt | Classify this audience question as one of: technical, opinion, off-topic. Reply with one word.\n\nQuestion: {{ctx.question.text}} |
| Temperature | 0 (deterministic) |
| Max tokens | 5 |
Then flow.branch_if on the captured classification to route between channels.
Troubleshooting
insufficient_quota
Your OpenAI account is out of credit. Top up at platform.openai.com/account/billing. The test endpoint (/v1/models) is free, so a connection can still test green while real chat completions fail — watch for this when bills lapse.
invalid_api_key
The key was revoked or has a typo. Generate a new key on the OpenAI dashboard, paste into Tevyr via Edit on the connection.
Response truncated mid-sentence
Your max_tokens is too low. Raise it. OpenAI doesn't error on a token cap — it just stops generating, so the response looks like an unfinished sentence.
rate_limit_error
OpenAI's per-account rate limit. Back off by inserting flow.wait_ms (e.g. 500 ms) between calls, or move to a higher tier in OpenAI's account settings.
"The bill is bigger than I expected"
GPT-4o costs ~$5 per million input tokens; gpt-4o-mini is ~30× cheaper. Switch to mini for high-volume macros (Q&A classification, tease generation). The action's model dropdown shows approximate pricing — start with mini and graduate up only if quality demands it.
Context variables
The prompt field supports {{ctx.*}} interpolation — Tevyr resolves placeholders at fire time so your prompt knows what session is active, how much time is left, etc. See the full context-variable reference in the Macros guide. Common ones: {{ctx.event.title}}, {{ctx.session.title}}, {{ctx.session.speaker_name}}, {{ctx.timer.remaining_seconds}}, {{ctx.now.iso}}.
Triggered by webhook events
OpenAI can be fired automatically from any webhook event. When creating a webhook, pick Integration mode and select your OpenAI connection — your prompt receives the event's {{ctx.*}} data at fire time.
Related
- Macros — capture an OpenAI response in one step, use it in the next (Slack post, Notion write, etc.)
- Integrations overview — other tools you can wire alongside OpenAI
- Anthropic guide — same recipe shape, routed through Claude
- Slack guide — paired with OpenAI to post generated content