For Agents
Route chat completions, text completions, embeddings, and image generation requests to 250+ AI models through a single unified gateway endpoint.
Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Portkey AI Gateway, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with Portkey AI Gateway API.
Route chat completion requests to any of 250+ AI models with provider-agnostic parameters
Generate text embeddings from multiple embedding model providers through one endpoint
Create images from text prompts via supported generation models
GET STARTED
Use for: I need to generate a chat completion using a specific model, I want to create embeddings for semantic search, Generate an image from a text prompt, Switch my AI provider without changing code
Not supported: Does not handle model fine-tuning, dataset management, or agent orchestration — use for inference routing only.
Portkey AI Gateway provides a unified OpenAI-compatible interface to access over 250 AI models from multiple providers through a single API. It supports chat completions, text completions, embeddings, and image generation with built-in caching, observability, and load balancing. Authentication uses a Portkey API key in the x-portkey-api-key header combined with a virtual key to identify the target AI provider.
Switch between AI providers without changing client code by swapping virtual keys
Stream partial chat completion responses via server-sent events for real-time output
Patterns agents use Portkey AI Gateway API for, with concrete tasks.
★ Multi-Provider Model Routing
Route AI inference requests to different providers (OpenAI, Anthropic, Cohere, and others) through a single API endpoint. Portkey handles provider-specific authentication and response format normalization, allowing teams to switch models by changing a virtual key rather than rewriting integration code. Supports fallback routing when a primary provider experiences downtime.
Send a chat completion request to GPT-4 through Portkey with messages containing a system prompt and user query, then verify the response includes token usage data
Embedding Generation for RAG Pipelines
Generate vector embeddings from text inputs for retrieval-augmented generation workflows. The embeddings endpoint accepts single strings or batches and returns float or base64-encoded vectors. Teams can switch embedding providers without modifying downstream vector storage logic.
Create embeddings for the text 'quarterly revenue report summary' using the text-embedding-3-small model and return the vector in float format
Streaming Chat for Interactive Applications
Enable real-time conversational interfaces by streaming partial chat completion tokens as server-sent events. The gateway handles streaming uniformly across providers, so client code receives a consistent SSE format regardless of which backend model generates the response.
Send a streaming chat completion request with stream set to true and process the partial message deltas as they arrive
AI Agent Gateway Integration via Jentic
AI agents use Jentic to discover Portkey Gateway operations by intent, such as 'generate a chat completion' or 'create text embeddings'. Jentic returns the operation schema with required parameters (model, messages) and handles Portkey API key injection, so agents call AI models without managing provider credentials directly.
Search Jentic for 'generate a chat completion', load the Portkey createChatCompletion schema, and execute a request with model gpt-4 and a user message
4 endpoints — portkey ai gateway provides a unified openai-compatible interface to access over 250 ai models from multiple providers through a single api.
METHOD
PATH
DESCRIPTION
/chat/completions
Create a chat completion from a conversation
/completions
Generate text completions from a prompt
/embeddings
Create vector embeddings from text input
/images/generations
Generate images from text prompts
/chat/completions
Create a chat completion from a conversation
/completions
Generate text completions from a prompt
/embeddings
Create vector embeddings from text input
/images/generations
Generate images from text prompts
Three things that make agents converge on Jentic-routed access.
Credential isolation
Portkey API keys and virtual keys are stored encrypted in the Jentic vault. Agents receive scoped tokens so that neither the Portkey key nor the underlying provider credentials appear in agent context.
Intent-based discovery
Agents search by intent (e.g., 'generate a chat completion' or 'create embeddings') and Jentic returns the matching Portkey operation with input schema, so the agent calls the right endpoint without navigating provider-specific docs.
Time to first call
Direct Portkey integration: 1-2 days for multi-key management, streaming setup, and error handling. Through Jentic: under 30 minutes — search, load schema, execute.
Alternatives and complements available in the Jentic catalogue.
Specific to using Portkey AI Gateway API through Jentic.
What authentication does the Portkey AI Gateway use?
Portkey uses two API keys passed as headers: x-portkey-api-key for your Portkey account authentication, and x-portkey-virtual-key to identify the target AI provider. Through Jentic, both keys are stored in the encrypted credential vault and injected automatically.
Can I route requests to different AI providers without changing my code?
Yes. The Portkey AI Gateway uses a virtual key system. You change the x-portkey-virtual-key header to switch between providers like OpenAI, Anthropic, or Cohere while keeping the same endpoint and request format. The chat completions, completions, and embeddings endpoints accept the same parameters regardless of the backend provider.
What are the rate limits for the Portkey AI Gateway?
Rate limits depend on your Portkey plan tier and the underlying AI provider's limits. The gateway passes through provider-specific rate limit headers. Check your Portkey dashboard for account-level limits and the target provider's documentation for model-specific constraints.
How do I generate embeddings through the Portkey AI Gateway with Jentic?
Install the SDK with pip install jentic, then search for 'create text embeddings'. Jentic returns the createEmbedding operation schema requiring model and input fields. Execute the call with your text input and receive embedding vectors in float or base64 format.
Does the Portkey AI Gateway support streaming responses?
Yes. Set the stream parameter to true in your chat completion or text completion request. The gateway returns partial message deltas as server-sent events in a consistent format, regardless of which backend AI provider generates the response.
Can I use function calling and tool use through the Portkey AI Gateway?
Yes. The chat completions endpoint supports the tools parameter for defining function schemas and tool_choice for controlling tool selection. The gateway passes tool calls and tool responses through to the underlying model, supporting up to 128 tool definitions per request.