Complete guide to integrate OpenAI API with Portkey. Support for gpt-4o, o1, chat completions, vision, and audio APIs with built-in reliability and monitoring features.
Your Gateway is running on http://localhost:8080/v1 🚀 |
---|
baseURL
to the local Gateway URL, and make requests:
text-embedding-3-small
) transform text inputs into lists of floating point numbers - smaller distances between vectors indicate higher text similarity. They power use cases like semantic search, content clustering, recommendations, and anomaly detection.
Simply send text to the embeddings API endpoint to generate these vectors for your applications.
gpt-4o-realtime
for full capabilitiesgpt-4o-mini-realtime
for lighter applicationsStreaming
Predicted Outputs
Fine-Tuning
Batch Inference
Assistants
Moderations
Reasoning
Track End-User IDs
user
parameter, Portkey allows you to send arbitrary custom metadata with your requests. This powerful feature enables you to associate additional context or information with each request, which can be useful for analysis, debugging, or other custom use cases.Setup Fallbacks & Loadbalancer
Setup Guardrails
Cache Requests
Send Custom Metadata
Send Custom Metadata
Setup Rate Limits
Create & Deploy Prompt Templates
Managing OpenAI Orgs on Portkey
Using Virtual Keys
Using Configs
While Making a Request
List of supported & unsupported parameters from OpenAI
Method / Endpoint | Supported Parameters |
---|---|
completions | model, prompt, max_tokens, temperature, top_p, n, stream, logprobs, echo, stop, presence_penalty, frequency_penalty, best_of, logit_bias, user, seed, suffix |
embeddings | model, input, encoding_format, dimensions, user |
chat.completions | model, messages, functions, function_call, max_tokens, temperature, top_p, n, stream, stop, presence_penalty, frequency_penalty, logit_bias, user, seed, tools, tool_choice, response_format, logprobs, top_logprobs, stream_options, service_tier, parallel_tool_calls, max_completion_tokens |
image.generations | prompt, model, n, quality, response_format, size, style, user |
create.speech | model, input, voice, response_format, speed |
create.transcription | All parameters supported |
create.translation | All parameters supported |
List of OpenAI models supported by Portkey
Is is free to use the OpenAI API key?
I am getting rate limited on OpenAI API
Can I fine-tune OpenAI models on vision requests?
Can I use gpt-4o or other chat models to generate images?
What type of files can I upload for vision requests?
For vision requests, Iis there a limit to the size of the image I can upload?
How do rate limits work for vision requests?
Can models understand image metadata?
How can I tell how many tokens a string has before I embed it?
How can I retrieve K nearest embedding vectors quickly?
Do V3 embedding models know about recent events?
text-embedding-3-large
& text-embedding-3-small
) is September 2021 - so they do not know about the most recent events.How is data privacy maintained for caches?
Does Prompt Caching affect output token generation or the final response of the API?
Is there a way to manually clear the cache?
Will I be expected to pay extra for writing to Prompt Caching?
Do cached prompts contribute to TPM rate limits?
Is discounting for Prompt Caching available on Scale Tier and the Batch API?
Does Prompt Caching work on Zero Data Retention requests?
What's the difference between DALL·E 2 and DALL·E 3?
How long do the generated image URLs last?
What are the size requirements for uploading images?
Can I disable DALL·E 3's automatic prompt enhancement?
How many images can I generate per request?
What image formats are supported?
How does image editing (inpainting) work?
What audio file formats are supported?
Can I translate audio to languages other than English?
How do I handle audio files longer than 25 MB?
Does the API support all languages equally well?
Can I get timestamps in the transcription?
timestamp_granularities
parameter, you can get timestamps at the segment level, word level, or both.How can I improve transcription accuracy for specific terms?
What's the difference between transcription and translation?
What are the differences between TTS-1 and TTS-1-HD models?
Which audio formats are supported?
Can I create or clone custom voices?
How well does it support non-English languages?
Can I control the emotional tone or style of the speech?
Is real-time streaming supported?
Do I need to disclose that the audio is AI-generated?