Pi APIpi.ai ↗
Query Pi (by Inflection AI) via a single API endpoint. Get Pi's full text answer, message IDs, and timestamps for any free-text question up to 4000 characters.
What is the Pi API?
The Pi.ai API exposes 1 endpoint — ask_question — that sends any free-text question to Pi, Inflection's conversational AI, and returns 6 structured fields including Pi's complete answer text, a UTC timestamp, and conversation and message identifiers. Each call opens a fresh anonymous conversation, so there is no session state to manage between requests. Suitable for integrating Pi's conversational responses into pipelines, experiments, or applications.
curl -X GET 'https://api.parse.bot/scraper/a7c2d333-4228-4f13-a618-3d03bd1e670e/ask_question?question=What+is+the+capital+of+France%3F' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace pi-ai-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Pi AI API — ask a question and inspect the typed answer."""
from parse_apis.pi_ai_api import PiAI, InputFormatInvalid
client = PiAI()
# Ask Pi a question and read typed fields from the response.
try:
answer = client.answers.ask(question="What are three fun facts about octopuses?")
except InputFormatInvalid:
print("Question was rejected — check that it is 1-4000 non-blank characters.")
else:
print(answer.question)
print(answer.answer)
print("conversation:", answer.conversation_id)
print("answered at:", answer.answered_at)
print("exercised: answers.ask")
Sends one question to Pi in a brand-new anonymous conversation and returns Pi's complete answer as plain text once generation finishes. Each call is independent: no context carries over between calls, and the returned conversation_id and message ids are informational identifiers minted by the site for that exchange (they cannot be used to continue the conversation through this API). Two round trips per call; typical latency is a few seconds and grows with answer length. Answers may contain emoji and Markdown line breaks. A blank question is rejected with a 422 input error; questions are capped at 4000 characters.
| Param | Type | Description |
|---|---|---|
| questionrequired | string | The question or message to send to Pi. Free text, 1-4000 characters after trimming whitespace. |
{
"type": "object",
"fields": {
"answer": "Pi's complete answer text, assembled from the streamed reply",
"question": "the trimmed question text that was sent",
"answered_at": "ISO 8601 UTC timestamp when Pi's reply was created",
"conversation_id": "site identifier of the anonymous conversation created for this exchange",
"answer_message_id": "site identifier of Pi's reply message",
"question_message_id": "site identifier of the user's message"
},
"sample": {
"data": {
"answer": "The capital of France is Paris. 🇫🇷",
"question": "What is the capital of France?",
"answered_at": "2026-09-29T08:27:17.066Z",
"conversation_id": "s9EpnDp3kmc7H2Mgqkwsq",
"answer_message_id": "2tAFbcd8TaLLoxoVj11qg",
"question_message_id": "L9BSc6SiPaZvbQmNx3kHB"
},
"status": "success"
}
}About the Pi API
What the API Returns
The ask_question endpoint accepts a question string (1–4000 characters after whitespace trimming) and returns Pi's complete reply once generation finishes. The primary payload field is answer, which contains Pi's full response as plain text. Alongside it, the response includes question (the trimmed input that was sent), answered_at (an ISO 8601 UTC timestamp marking when Pi's reply was created), and three identifier fields: conversation_id, answer_message_id, and question_message_id.
Conversation Scope and Statefulness
Every call to ask_question creates a new, independent anonymous conversation on Pi.ai. Context from a previous call does not carry over — there is no thread or session parameter. If your use case requires multi-turn dialogue, you would need to construct a self-contained question that includes any necessary context within the 4000-character limit of the question field.
Identifiers and Timestamps
The conversation_id, answer_message_id, and question_message_id fields are site-level identifiers for the exchange. They are informational: useful for logging, deduplication, or debugging, but they cannot be passed back into a subsequent call to resume the same conversation. The answered_at timestamp reflects when Pi's reply was produced, which can help with latency measurement or response logging.
The Pi API is a managed, monitored endpoint for pi.ai — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when pi.ai changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official pi.ai API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Automated Q&A testing: send a fixed set of questions to Pi and log the
answerandanswered_atfields to track response changes over time. - Content drafting assistance: pipe a topic or prompt into
questionand collect Pi's reply text for editorial review workflows. - Chatbot fallback routing: forward unhandled user inputs to Pi via
ask_questionand surface the returnedanswerwhen no internal handler matches. - Research logging: capture
conversation_idandanswer_message_idalongside each query to maintain an auditable record of AI-generated responses. - Latency benchmarking: use the
answered_attimestamp to measure response generation time across different question lengths and categories. - Educational tooling: build a study-aid interface that submits student questions and displays Pi's
answeralongside the originalquestiontext.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Pi.ai have an official developer API?+
What exactly does the `ask_question` endpoint return beyond the answer text?+
answer field containing Pi's full reply, the endpoint returns the trimmed question string that was sent, an answered_at ISO 8601 UTC timestamp, and three identifiers: conversation_id, answer_message_id, and question_message_id. These identifiers are informational and cannot be used to continue a conversation in a subsequent call.Can I send follow-up messages to continue a conversation across multiple API calls?+
ask_question starts a fresh anonymous conversation, and no context from prior calls is retained. The API covers single-turn question-and-answer exchanges only. You can fork this API on Parse and revise it to add a multi-turn endpoint that accepts a conversation history or thread parameter.Is there a limit to how long my question can be?+
question input accepts free text between 1 and 4000 characters after whitespace trimming. Questions outside this range will be rejected at the API level before a request is made.Does the API return Pi's response in any format other than plain text, such as markdown or structured JSON fields within the answer?+
answer field is returned as plain text. Structured sub-fields within the answer body, voice output, or alternative format options are not currently exposed. You can fork this API on Parse and revise it to add post-processing or format-conversion logic to the returned answer text.