Headers
Copy page
Pass dynamic context to your agents via HTTP headers for personalized interactions
Overview
Headers allow you to pass request-specific values (like user IDs, authentication tokens, or organization metadata) to your agent at runtime via HTTP headers. These values are validated and made available throughout your agent system for:
- Context Fetchers: Dynamic data retrieval based on request values
- External Tools: Authentication and personalization for API calls
- Agent Prompts: Personalized responses using context variables
Configuring Headers
- Go to the Agents tab in the left sidebar. Then click on the agent you want to configure.
- On the right pane scroll down to the "Headers schema" section.
- Enter the schema in JSON Schema format.
- Click on the "Save" button.
Here is an example of a valid headers schema:
You can generate custom schemas using this JSON Schema generator.
Sending Custom Headers
- On your agent page, click on the Try it button in the top right corner.
- Click on the "Custom headers" button in the top right corner.
- Enter the custom headers in JSON format.
- Click on the "Apply" button.
Header Validation
When you enter custom headers in the playground, they are validated in real-time against the configured headers schema. If the headers are invalid or missing required fields, the chat input is disabled and an error message is displayed. You must fix validation errors before you can send messages.
Using Headers in Your Agent Prompts
- Go to the Agents tab in the left sidebar. Then click on the agent you want to configure.
- Either add a new agent or edit an existing agent by clicking on the agent you want to edit.
- On the right pane scroll down to the "Prompt" section.
- Use the double curly braces
{{}}to reference the headers variables.
Here is an example of a valid prompt: