Skip to main content
If something isn’t working, use this guide to diagnose and fix the most common issues with the Pinaivu API. Each section describes the likely cause and the steps to resolve it.

Authentication errors (401 / 403)

A 401 Unauthorized response means your request reached the API without a valid API key. A 403 Forbidden response means your key was recognized but lacks permission for the action you’re attempting. Common causes:
  • The Authorization header is missing entirely.
  • The key is malformed or was copied with extra whitespace.
  • The key has been revoked or has expired.
How to fix it:
1

Check the Authorization header

Make sure every request includes the header in exactly this format:
Authorization: Bearer sk-pnv-...
Here’s a minimal curl call you can use to confirm your key is working:
curl https://api.pinaivu.com/v1/models \
  -H "Authorization: Bearer sk-pnv-..."
A 200 OK response confirms the key is valid.
2

Regenerate your key if needed

If the key is invalid or compromised, log in to the dashboard at https://api.pinaivu.com, revoke the old key under API Keys, and generate a new one.
3

Update your environment variable

Store the new key in your environment and restart any running processes:
export PINAIVU_API_KEY="sk-pnv-..."
Never commit your sk-pnv-... key to version control. If you suspect it has been exposed, revoke it immediately from the dashboard.

Rate limiting (429)

A 429 Too Many Requests response means you’ve exceeded your per-key request quota within a given time window. Common causes:
  • Sending requests in a tight loop without any delay.
  • A sudden spike in traffic from your application.
How to fix it: Implement exponential backoff so your code waits progressively longer between retries. The Retry-After header in the 429 response tells you the minimum number of seconds to wait.
Python
import time
import openai

client = openai.OpenAI(
    api_key="sk-pnv-...",
    base_url="https://api.pinaivu.com/v1",
)

MAX_RETRIES = 6

for attempt in range(MAX_RETRIES):
    try:
        response = client.chat.completions.create(
            model="llama3.2:3b",
            messages=[{"role": "user", "content": "Hello"}],
        )
        print(response.choices[0].message.content)
        break
    except openai.RateLimitError:
        wait = 2 ** attempt          # 1s, 2s, 4s, 8s, 16s, 32s
        print(f"Rate limited. Retrying in {wait}s...")
        time.sleep(wait)
else:
    print("Exceeded maximum retries.")
If your workload legitimately requires higher throughput, contact support to discuss raising your rate limits.

Model not found

A 404 or model-not-found error means the model ID in your request doesn’t match any currently active model on the network. Common causes:
  • A typo in the model name (e.g. llama-3.2-3b instead of llama3.2:3b).
  • The model you’re targeting is temporarily unavailable.
How to fix it: Query the /v1/models endpoint to get the exact IDs of all models that are active right now:
curl https://api.pinaivu.com/v1/models \
  -H "Authorization: Bearer sk-pnv-..."
The response lists each model’s id field — use that value verbatim in your requests. Currently available models include llama3.2:1b and llama3.2:3b.

Validation error (422)

A 422 Unprocessable Entity response means the request body failed schema validation. Your JSON was well-formed and your key was accepted, but one or more fields were missing, had the wrong type, or contained an out-of-range value. Common causes:
  • The model field is missing or uses an incorrect ID format (e.g. llama-3.2-3b instead of llama3.2:3b).
  • A messages entry is missing the role or content property.
  • A numeric parameter such as temperature or max_tokens is outside its allowed range.
How to fix it: Read the detail field in the error response body — it identifies exactly which field failed and why:
{
  "detail": [
    {
      "loc": ["body", "model"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}
Correct the identified field and retry. To confirm the exact model IDs currently accepted, fetch the live model list:
curl https://api.pinaivu.com/v1/models \
  -H "Authorization: Bearer sk-pnv-..."
See GET /v1/models for the full response schema.

No nodes available (503)

A 503 Service Unavailable response means your request could not be routed to a GPU node — either all nodes are at capacity or the network is in the middle of recovering from a transient issue. Common causes:
  • A temporary surge in demand across the network.
  • A small number of nodes going offline simultaneously.
How to fix it: The Pinaivu network is self-healing. Retry your request with exponential backoff and it will typically succeed within a few seconds:
Python
import time
import openai

client = openai.OpenAI(
    api_key="sk-pnv-...",
    base_url="https://api.pinaivu.com/v1",
)

for attempt in range(5):
    try:
        response = client.chat.completions.create(
            model="llama3.2:3b",
            messages=[{"role": "user", "content": "Hello"}],
        )
        print(response.choices[0].message.content)
        break
    except openai.APIStatusError as e:
        if e.status_code == 503:
            wait = 2 ** attempt
            print(f"No nodes available. Retrying in {wait}s...")
            time.sleep(wait)
        else:
            raise
If you see persistent 503 errors over several minutes, check https://explorer.pinaivu.com to see current network status.

Wrong base URL for OpenAI SDK

If you’re using the OpenAI SDK and receiving connection errors or unexpected 404 responses, your base_url may still be pointing at api.openai.com instead of the Pinaivu gateway. How to fix it: Set base_url (Python) or baseURL (Node.js) to https://api.pinaivu.com/v1:
from openai import OpenAI

client = OpenAI(
    api_key="sk-pnv-...",          # your Pinaivu key
    base_url="https://api.pinaivu.com/v1",
)

response = client.chat.completions.create(
    model="llama3.2:3b",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
Do not append a trailing slash to the base URL. Use https://api.pinaivu.com/v1, not https://api.pinaivu.com/v1/.

Missing request_id in response

Every successful inference response from Pinaivu includes a request_id that you can use to verify the computation on the explorer. If you don’t see one, the request likely did not complete successfully. Common causes:
  • The request returned an error status (4xx or 5xx) and was never routed to a node.
  • The response was parsed before checking for errors, masking the failed status code.
How to fix it:
1

Check the HTTP status code first

Before reading the response body, confirm the status is 200 OK. Any error response (401, 429, 503, etc.) will not carry a request_id.
2

Inspect the full response object

Log or print the raw response to ensure you’re reading the correct field. The request_id appears at the top level of the response body:
{
  "id": "chatcmpl-...",
  "request_id": "req_abc123...",
  "choices": [ ... ]
}
3

Retry the request

If a valid request consistently returns no request_id, retry once. A transient routing failure can occasionally result in an incomplete response object.

For issues not covered here, contact the Pinaivu support team or visit https://explorer.pinaivu.com to inspect your requests at the node level and gather the details needed to diagnose the problem.