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:
π§ Example: OpenAI Chat Completion
π¨ Example: OpenAI Image Generation
π₯ 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)
π¨ 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
π Upstream Provider Error Example (Forwarded)
β Tip: JetPero distinguishes between JetPero proxy errors and upstream provider errors. You can use the HTTP status codes and
error.type
orcode
fields to handle them in your application logic.
π§ͺ Testing Your API Call
To verify that your configuration is correct:
Use Postman, curl, or your preferred HTTP client.
Add the correct
Authorization
header with your project-specific token.Use an endpoint that your provider supports (check their official docs).
Review both the request and response for debugging.
π§© Best Practices
Always use your JetPero project token in the header:
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.
Last updated