# Ask AI

> Have AI write a reply from what you tell it, such as your server's rules.

Source: https://docs.buildcord.dev/nodes/integrations/ask-ai/

`integration.ask` answers a question in a reply AI writes from what you've told it: your rules, answers to common questions, how your server works. Use it for an FAQ or support bot. Send the reply with a later step.

## Settings

| Setting | What it does |
| --- | --- |
| Question | What to answer, such as `{message.content}` or a command's `{option.question}`. Up to 2,000 characters are read. |
| What it knows | Your rules, answers to common questions, and how it should answer, such as “Be friendly and brief.” It answers from this and says when it doesn't know. Up to 6,000 characters are read. |
| Pictures | Pictures for it to look at with the question, such as a screenshot of a worksheet: one address per line, up to 4. Use `{message.files}` for a message's attachments, or a form's file upload. |
| Length | **A sentence or two**, **A short paragraph** or **A few paragraphs**. |

## Ways out

| Way out | When |
| --- | --- |
| Replied | AI wrote a reply. |
| No reply | This month's AI replies are used up, AI couldn't be reached, or the bot asked too many times this minute. `{ai.error}` says which. |

## Produces

| Token | Value |
| --- | --- |
| `{ai.reply}` | The reply, up to 2,000 characters, so it fits in one message |
| `{ai.error}` | Why there's no reply, on the No reply way |

## Limits and price

Every reply counts against the AI replies of the bot owner's account for the calendar month (UTC), apart from [agent turns](https://docs.buildcord.dev/concepts/plans). Bots shared with you use their owner's.

- **Free**: 100 a month.
- **Lite**: 500 a month.
- **Paid**: 2,000 a month. Past that, replies are $1 per 1,000, up to a monthly limit you set on the Billing page. It starts at $10, which is 10,000 more replies. Set it to $0 to stop at 2,000. On a yearly plan they're billed as they add up.

On Free and Lite, a [pack](https://docs.buildcord.dev/concepts/plans#packs) of 2,000 more replies is $5, paid once, and its replies are used after the plan's. Without one, the step goes the No reply way until the month is over.

The Billing page shows how many you've used this month.

## Notes

- A bot can ask up to 60 times a minute. Past that, the step goes the No reply way until the minute is up.
- A test run doesn't ask AI, so it uses none of your replies. `{ai.reply}` holds a stand-in.
- What it knows is all it has to go on. If it keeps saying it doesn't know, add the answer there.
- Answering every message in a busy channel uses replies quickly. A slash command such as `/ask`, or a channel set aside for questions, keeps it to the people asking.
- Reading a message's text in an event flow needs the Message Content intent.
- AI only looks at pictures sent in Discord or kept in your bot's files. They're passed to it by address when it answers and aren't stored anywhere. A picture counts as part of the same reply.
- To have it read a question from a picture, put something like “Write out the question in the picture, then explain how to solve it step by step” in What it knows.

## Example

A slash command `/ask` with a `question` option. Ask AI answers `{option.question}` from your rules and FAQ, and a reply step sends `{ai.reply}`. From **No reply**, send “I can't answer right now. Ask a moderator.” The [AI helper](https://buildcord.dev/templates/ai-helper/) template is this flow, ready to fill in.

## Related

- [Slash command](https://docs.buildcord.dev/nodes/triggers/slash-command)
- [Decide with AI](https://docs.buildcord.dev/nodes/integrations/decide-with-ai)
- [Plans and gateway bots](https://docs.buildcord.dev/concepts/plans)
