Configure Claude.ai for AI Review Assistant
This page describes how to configure Claude AI as your AI provider for AI Review Assistant.
As a repository administrator, follow these steps:
Go the Code Review Assistant repository settings
Make sure you are in the AI Review Assistant tab on top
In the API URL section, enter the REST API address for Claude AI:
https://api.anthropic.com/v1/messages
.In the Headers section, click on the “Add Header” button. Enter
x-api-key
on the left side, and$API_SECRET
on the right side.Still in the Headers section, click on the ➕ icon. Enter
anthropic-version
on the left side, and2023-06-01
on the right side. The headers configuration should look like the followingNote: the
2023-06-01
is the most up-to-date version at the time of this writing. Consult the official Claude documentation to check whether a new version is available.In the Request Body section, click on the ➕ icon. Enter
model
in the input, then click onAdd > Text
and enterclaude-3-5-sonnet-20241022
. As for the version, check the list of available models using Claude’s API.Still in the Request Body section, click on the ➕ icon. Enter
max_tokens
in the input, then click onAdd > Number
and enter, e.g.,1024
. The body configuration should look like the following
(Optional/Advanced) Customize the request body even further. Still in the Request Body section, add other optional parameters as documented in the official Claude AI documentation.
In the API Key section, enter your Claude API key.
In the Response Mapping JQL section, enter
content[0].text
.In the Response Error Mapping JQL section, enter
error.message
.Click on the “Test” button. Check that you get the validation that everything is configured properly.
Click “Save” to save your configuration.
If you have trouble in configuring our AI Review Assistant, we are happy to help! 🎉