Before you begin
- A Potpie account
- An API key ,if you don’t have one yet see Generate an API Key
x-api-key header.
Step 1 : Parse a repository
Parsing builds the context graph for your repository. Every subsequent API call like creating conversations, sending messages requires aproject_id from this step.
Absolute path to a local repository. Only works when
isDevelopmentMode=enabled. Use this instead of repo_name for local development.project_id . You’ll use it in every request from here on.
Step 2 : Wait for parsing to complete
Parsing runs asynchronously. Poll the status endpoint untilstatus is ready before creating a conversation.
submitted → cloned → parsed → processing → inferring → ready
If parsing fails at any stage, status becomes error.
To manage conversations and messages as separate steps, continue to Step 3. To create a conversation and send a message in a single request, jump to create conversation and send message in one call.
Step 3 : Create a conversation
A conversation connects your project to an agent. Choose the agent based on what you want to do.Generates and modifies code based on your instructions, with awareness of existing patterns in the repo.
Produces technical specifications from codebase context or a description of what you want to build.
conversation_id. Use it in all subsequent message requests.
Step 4 : Send a message
Send your question or instruction to the conversation. Responses stream by default.stream=true, default)
Chunks are yielded as JSON objects as they arrive:
stream=false)
The full response is returned once the agent finishes:
Create conversation and send message in one call
For quick, one-off queries you can skip managing aconversation_id entirely. This endpoint creates the conversation and sends the first message in a single request. The conversation is hidden from the UI by default.
Whether to hide the conversation from the web UI. Defaults to
true.
