curl --request GET \
--url https://api.pyai.com/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pyai.com/v1/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pyai.com/v1/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pyai.com/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pyai.com/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "identity",
"key_id": "key_7f3a0b12",
"org_id": "org_abc123",
"project_id": "proj_abc123",
"env": "test",
"status": "active",
"org_status": "active",
"scopes": [
"speak:synthesize",
"hear:transcribe"
],
"expires_at": 123,
"plan": "payg",
"limits": {
"rps": 123,
"burst": 123,
"concurrency": 123,
"monthly_units": 123,
"daily_unit_cap": 123
},
"credit": {
"gated": true,
"available_cents": 123
},
"key_budget_cents": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Introspect the calling key (whoami)
Return the identity the gateway resolved for your key: key_id, org_id, project_id, environment (test/live), status, the granted scopes, and the rate-limit/credit posture. Any active key may call it (no special scope), so it is the fastest way to self-diagnose a 403 insufficient_scope (check scopes), a 402 credit_exhausted/key_budget_exceeded (check credit and key_budget_cents), or an org_suspended (org_status).
curl --request GET \
--url https://api.pyai.com/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pyai.com/v1/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pyai.com/v1/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pyai.com/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pyai.com/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "identity",
"key_id": "key_7f3a0b12",
"org_id": "org_abc123",
"project_id": "proj_abc123",
"env": "test",
"status": "active",
"org_status": "active",
"scopes": [
"speak:synthesize",
"hear:transcribe"
],
"expires_at": 123,
"plan": "payg",
"limits": {
"rps": 123,
"burst": 123,
"concurrency": 123,
"monthly_units": 123,
"daily_unit_cap": 123
},
"credit": {
"gated": true,
"available_cents": 123
},
"key_budget_cents": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Authorizations
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Response
The calling key's identity and limits.
The identity the gateway resolved for the calling key, plus its enforced limits and credit posture. Returned by GET /v1/me.
"identity"
The calling key's id.
"key_7f3a0b12"
"org_abc123"
"proj_abc123"
Key environment. test keys run in the sandbox tier (daily unit cap, no credit gate).
test, live Key status.
active, revoked Owning org status; suspended explains a 403 org_suspended.
active, suspended Granted scopes. A missing scope here explains a 403 insufficient_scope.
["speak:synthesize", "hear:transcribe"]
Key expiry (Unix ms); null = non-expiring.
Billing plan id.
"payg"
Per-key gateway limits (what the edge actually enforces).
Show child attributes
Show child attributes
Prepaid-credit posture. Explains a 402 credit_exhausted.
Show child attributes
Show child attributes
Per-key monthly spend cap (USD cents); null = no per-key budget. Hitting it is a 402 key_budget_exceeded.