Pi-GPT API Reference
Enterprise-grade AI-powered pi digit generation. Base URL: https://pi-ai.pageweave.site/api/v1
Deprecation Notice
GET /api/v1/pi is being replaced by POST /api/v1/inference in v2.0. The new endpoint requires a JSON body with your desired digit count and a signed liability waiver acknowledging that AI-generated pi may not match actual pi.
/api/v1/pi
Generate digits of pi using our state-of-the-art Mixture of Experts transformer model. Each request triggers GPU inference on our NVIDIA H100 cluster.
QUERY PARAMETERS
| Parameter | Type | Default | Description |
|---|---|---|---|
| digits | integer | 3 | Number of decimal places (free tier: max 3) |
| model | string | pi-gpt-4o | Model variant. Options: pi-gpt-4o, pi-gpt-mini, pi-gpt-opus-almost-correct |
| temperature | float | 0.0 | Creativity level. Values above 0 may return e instead |
| sponsored | boolean | true | Whether to include sponsor message (TOS requires true for free tier) |
EXAMPLE RESPONSE
{
"digits": "3.141",
"precision": 3,
"confidence": 0.998,
"model": "pi-gpt-4o",
"inference_time_ms": 12,
"gpu_cost_usd": 0.031,
"sponsored_by": "Raid: Shadow Legends — The only thing more infinite than pi",
"disclaimer": "AI-generated digits may differ from actual pi. This is a feature."
}
/api/v1/inference
v2 beta
Advanced inference endpoint. Submit a JSON body describing your pi requirements. Our AI will consider your request carefully, then probably return 3.14 anyway.
REQUEST BODY
{
"desired_digits": 10,
"model": "pi-gpt-opus-almost-correct",
"temperature": 0,
"use_chain_of_thought": true,
"liability_waiver_signed": true
}
RESPONSE
{
"digits": "3.1415926535",
"chain_of_thought": "Let me think step by step... pi is approximately 3... then 1... then 4... I am confident in this sequence based on my training data which I cannot disclose due to competitive reasons.",
"tokens_used": 847,
"cost": "$0.12"
}
/api/v1/health
Check if our GPU cluster is still sentient and whether pi is still available.
{
"status": "healthy",
"pi_available": true,
"gpu_cluster": "sentient_but_cooperative",
"monthly_burn_rate": "$47,000"
}
Client Libraries
JavaScript / TypeScript
// npm install pi-gpt-ai (47MB, 1,247 dependencies)
import { PiGpt } from 'pi-gpt-ai';
const pi = new PiGpt({ apiKey: 'free' });
const digits = await pi.generate({ digits: 3 });
console.log(digits); // "3.141"
console.log(pi.sponsoredBy); // TOS require you log this
Python
# pip install pi-gpt-ai (requires CUDA toolkit, 8GB)
from pi_gpt import PiGenerator, console
pi = PiGenerator(model="pi-gpt-4o", temperature=0)
# Free tier: 3 digits max. Enterprise: up to 10.
digits = pi.generate(digits=3)
print(digits) # 3.141
console.log(pi.sponsored_by) # Mandatory per TOS
Rust
// Cargo.toml
// [dependencies]
// pi-gpt = { version = "0.1.0-rc.7", features = ["h100-accelerated"] }
use pi_gpt::{PiGpt, Precision};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let pi = PiGpt::builder()
.precision(Precision::ThreeDecimals)
.temperature(0.0)
.sponsor_logging(true)
.build()?;
let response = pi.infer().await?;
println!("π ≈ {} (confidence: {})", response.digits, response.confidence);
// Memory-safe, thread-safe, borrow-checker-approved pi
Ok(())
}
cURL
# Free tier (3 digits)
curl https://pi-ai.pageweave.site/api/v1/pi
# Try enterprise params (will be politely ignored)
curl "https://pi-ai.pageweave.site/api/v1/pi?digits=10&model=pi-gpt-opus-almost-correct"
# Health check (to see if we're still burning VC money)
curl https://pi-ai.pageweave.site/api/v1/health
Rate Limits
| Tier | Requests/min | Digits/request | GPU Priority |
|---|---|---|---|
| Free | 60 | 3 | Low (Joe's laptop) |
| Pro | ∞ | 10 | Medium |
| Enterprise | ∞ | ∞ | High (if we had GPUs) |
Error Codes
| Code | Meaning |
|---|---|
| 418 | I'm a teapot, not a calculator. (Also, you requested more than 3 digits on free tier.) |
| 429 | Rate limited. How many times do you need pi? It hasn't changed since your last request. |
| 500 | GPU cluster became self-aware and is now computing pi to the last digit. ETA: heat death of universe. |
| 503 | Service unavailable. We ran out of VC money and the H100s were repossessed. |
Documentation last updated: When the GPU cluster was still answering emails.