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://jentic.com/install.sh?src=apis&api=%2Fapis%2Fportkey.ai%2Fportkey" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fportkey.ai%2Fportkey" | 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
What agents get from Jentic-routed access to this vendor.
Setup
Wiring the Portkey AI Gateway by hand means managing its x-portkey-api-key header, wiring a virtual key for each provider, and formatting inference requests yourself. Through Jentic you install once, import the Portkey AI Gateway from the API Directory, store the key once, and your agent calls it.
Permission scoping
Portkey takes its prompts and model inputs in the request body, so you limit the agent to the operations it needs, such as chat completions or embeddings. Other operations like image generation are available only if you add them.
Credential isolation
Your Portkey API key and virtual keys are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'generate a chat completion' or 'create embeddings', and Jentic returns the matching Portkey operation with its input schema so the agent calls the right endpoint without browsing the reference docs.
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.
Can I limit what my agent is allowed to do with the Portkey AI Gateway?
Yes. Because you run Jentic One yourself, your own rules decide which Portkey operations and credentials the agent may use. You can allow only the inference calls it needs, such as chat completions or embeddings, and leave text completions or image generation unimported so the agent cannot reach them. Since prompts and model inputs travel in the request body, scoping the agent to a single operation like chat completions keeps it from touching any endpoint you have not granted.