Skip to main content
This walks from a fresh key to a generative answer. Everything is one curl away.
1

Create a key

In the console, Configuration → API keys → Create key. Give it the scopes landings:write, knowledge:write, knowledge:read and chat:write, and copy the secret; it is shown once. Write never implies read: knowledge:read is what polling sources and the retrieval probe below need.
2

Confirm the key works

3

Create an agent

An agent is the brain the conversation answers from.
4

Teach it something

Add a fact. Ingestion is asynchronous: this answers 202 with the source pending.
Poll GET $WDY/knowledge/sources until the source is ready.
5

Ask it something

The generative turn spends one message credit and returns the answer plus any components it chose to render.
Continue the conversation by passing the conversationId back. For a token-by-token stream, send Accept: text/event-stream.

Before you ask, probe

To see what an agent would retrieve WITHOUT spending a credit, use the retrieval probe:
Empty passages mean the agent cannot answer that question yet. Add knowledge and try again.