OpenAI Actions
Example: AI Chat Bot
AI Chat Bot
Bot responds using OpenAI GPT

Telegram Bot
Bot Update
message
userID

OpenAI
Send Prompt
model
gpt-4
instructions
You are a helpful assistant
input
message
responseText

Telegram Bot
Send Message
chatId
userID
text
responseText
Send Prompt to OpenAI
Send a text prompt to an OpenAI model and receive a response.
Inputs
| Input | Type | Description |
|---|---|---|
| model | string | Model name (default: gpt-3.5-turbo). Options: gpt-4, gpt-4o, gpt-3.5-turbo |
| instructions | string | System prompt that sets the AI's behavior |
| input | string | The user's message or prompt |
Outputs
| Output | Type | Description |
|---|---|---|
| responseText | string | The AI-generated response |
| usage | json | Token usage: {"prompt_tokens": N, "completion_tokens": N, "total_tokens": N} |
Example Use Cases
- Echo bot with AI: Drag Telegram message → input, send responseText back
- Summarizer: Set instructions to "Summarize the following text", drag content → input
- Translator: "Translate to English" as instructions
- Data extractor: "Extract name, email, phone from this text. Return as JSON"