API Access
Getting started with the API
Using Potpie Agents through the API
Generating an API Key
To generate an API key, follow these steps:
- Navigate to app.potpie.ai.
- Click on your username in the bottom left corner.
- Select Key Management from the menu.
- In the “API Key Management” section, click on Generate API Key.
Your API key will be created and displayed for use.
Using the API
To use the API, follow these steps:
-
Base URL: Use
https://production-api.potpie.ai/
as the base URL. -
Parse API:
- API Path:
/api/v2/parse
- Request Method: POST
- Request Body:
- The Parse API will return a project ID.
- API Path:
-
Get Parsing Status:
- API Path:
/api/v2/parsing-status/{project_id}
- Request Method: GET
- Query Parameters:
project_id
: The ID returned from the Parse API.x-api-key
: Your API key (in the header).
- Wait until the project status is “ready”.
- API Path:
-
Create a Conversation:
- API Path:
/api/v2/conversations
- Request Method: POST
- Request Body:
- Note: Only one project ID and agent ID are supported per conversation.
- API Path:
List of Agents
You can choose from the following agents:
- Codebase Q&A Agent:
id="codebase_qna_agent"
- Debugging with Knowledge Graph Agent:
id="debugging_agent"
- Unit Test Agent:
id="unit_test_agent"
- Integration Test Agent:
id="integration_test_agent"
- Low-Level Design Agent:
id="LLD_agent"
- Code Changes Agent:
id="code_changes_agent"
- Code Generation Agent:
id="code_generation_agent"
- Send Message:
- API Path:
/api/v2/conversations/{conversation_id}/message
- Request Method: POST
- Request Body:
- Query Parameters:
conversation_id
: The ID of the conversation created in the previous step.x-api-key
: Your API key (in the header).
- API Path: