Skip to main content

Portkey

Portkey is an AI gateway that routes requests to hundreds of models through a single OpenAI-compatible API, adding observability, caching, routing and guardrails.

Because the gateway is OpenAI-compatible, TakeShape talks to Portkey with the same API as OpenAI. Which model provider Portkey forwards your requests to is decided by the provider you configure below, not by TakeShape.

Portkey connects as an AI service — you use it for generation and embeddings, in agents and AI resolvers. It doesn't add queries or mutations to your project's GraphQL API.

Connecting Portkey

Getting your API key

Log in to the Portkey app and navigate to API Keys. Create a key, then copy it for the next step.

Getting your provider slug

Portkey routes each request to a provider you've configured in the Model Catalog. Copy the slug of the provider you want to use — it looks like @takeshape-agent.

Getting your config ID (optional)

If you want every request from TakeShape to run through a Portkey config — for example, a config that applies Prisma AIRS guardrails — copy the config ID as well. Leave this blank to send requests without a config.

Adding the Portkey service

Now you're ready to configure your Portkey service. Log in to your project then click "Connect Service" on the dashboard page. Click "Portkey" to start configuring your service.

Paste in your provider slug, your config ID if you have one, and your API key, then click Save.

Using Portkey

Once connected, select the Portkey service anywhere you'd select an AI service — in agents, or in AIGenerateText and AIEmbedding resolvers.

Because the models you can use depend on the provider Portkey routes to, TakeShape doesn't offer a list to pick from — type the model name your Portkey provider exposes, for example claude-sonnet-5 or gpt-5. You can see which models your provider allows in the Portkey Model Catalog.