πŸš€
JetPero
  • Welcome to JetPero API Platform
  • Getting Started
    • Quickstart
  • Signup & Setup
  • Your First API Key
  • Basics
    • Integrations
    • API Requests & Responses
    • SDKs & Tools
  • Features
    • API Key Management
    • Monitoring & Analytics
    • Alerts & Notifications
    • Security
  • Plans & Limits
    • Pricing
    • Rate Limits
  • Help
    • Troubleshooting & FAQ
    • Contact Support
Powered by GitBook
On this page
  • βœ… Making API Requests
  • πŸ“₯ How the Response Works
  • 🚨 Common Error Formats
  • πŸ§ͺ Testing Your API Call
  • 🧩 Best Practices
  1. Basics

API Requests & Responses

JetPero simplifies how you interact with third-party APIs by acting as a secure proxy gateway. Whether you're calling OpenAI, ElevenLabs, HuggingFace, or any other provider, the process remains cl

βœ… Making API Requests

All requests through JetPero follow this pattern:

 https://api.jetpero.com/proxy/<provider-name>/<endpoint>

🧠 Example: OpenAI Chat Completion

curl https://api.jetpero.com/proxy/openai/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <Your-Project-Token>" \
  -d '{
    "model": "gpt-4",
    "messages": [
      {"role": "user", "content": "Tell me a joke"}
    ]
  }'

🎨 Example: OpenAI Image Generation

curl https://api.jetpero.com/proxy/openai/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <Your-Project-Token>" \
  -d '{
    "prompt": "A cyberpunk city at night",
    "n": 1,
    "size": "1024x1024"
  }'

πŸ“₯ How the Response Works

JetPero forwards the response from the original provider exactly as received, with no modification to the structure or data, so your existing integrations will continue to work as expected.

Example Response (Chat Completion)

{
  "id": "chatcmpl-1234567890",
  "object": "chat.completion",
  "created": 1712345678,
  "model": "gpt-4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Why did the web developer leave the restaurant? Because of the table layout."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 14,
    "total_tokens": 24
  }
}

🚨 Common Error Formats

When something goes wrong, JetPero provides clear and consistent error responses, even if the original provider’s format varies.

❌ JetPero Standard Error Example

{
  "error": {
    "status": 401,
    "message": "Invalid project token or expired authentication."
  }
}

πŸ”’ Upstream Provider Error Example (Forwarded)

{
  "error": {
    "message": "You exceeded your current quota, please check your plan and billing details.",
    "type": "insufficient_quota",
    "param": null,
    "code": "quota_exceeded"
  }
}

βœ… Tip: JetPero distinguishes between JetPero proxy errors and upstream provider errors. You can use the HTTP status codes and error.type or code fields to handle them in your application logic.


πŸ§ͺ Testing Your API Call

To verify that your configuration is correct:

  1. Use Postman, curl, or your preferred HTTP client.

  2. Add the correct Authorization header with your project-specific token.

  3. Use an endpoint that your provider supports (check their official docs).

  4. Review both the request and response for debugging.


🧩 Best Practices

  • Always use your JetPero project token in the header:

    Authorization: Bearer <Your-Project-Token>
  • Don’t expose your provider API keys β€” JetPero handles it behind the scenes.

  • Keep provider names consistent and lowercase (e.g., openai, huggingface, elevenlabs)

  • Handle 4xx and 5xx errors gracefully based on provider docs.

PreviousIntegrationsNextSDKs & Tools

Last updated 1 month ago