Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
"integrations/llms/github",
"integrations/llms/groq",
"integrations/llms/huggingface",
"integrations/llms/hpc-ai",
"integrations/llms/inference.net",
"integrations/llms/featherless",
"integrations/llms/jina-ai",
Expand Down Expand Up @@ -1229,6 +1230,7 @@
"guides/integrations/mistral",
"guides/integrations/vercel-ai",
"guides/integrations/deepinfra",
"guides/integrations/hpc-ai",
"guides/integrations/groq",
"guides/integrations/langchain",
"guides/integrations/mixtral-8x22b",
Expand Down Expand Up @@ -2218,6 +2220,7 @@
"guides/integrations/mistral",
"guides/integrations/vercel-ai",
"guides/integrations/deepinfra",
"guides/integrations/hpc-ai",
"guides/integrations/groq",
"guides/integrations/langchain",
"guides/integrations/mixtral-8x22b",
Expand Down
51 changes: 51 additions & 0 deletions guides/integrations/hpc-ai.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "HPC-AI"
---

## Portkey + HPC-AI

[Portkey](https://app.portkey.ai/) is the control plane for AI apps: AI Gateway, observability, prompt management, and more.

[HPC-AI](https://www.hpc-ai.com/) offers **Model APIs** with an **OpenAI-compatible** interface for chat completions.

### Quickstart

Portkey is compatible with the OpenAI request shape. Point the OpenAI client at the Portkey gateway and pass `provider` + your Portkey API key via `createHeaders`.

You need:

* A Portkey API key from [the Portkey app](https://app.portkey.ai/)
* An HPC-AI API key from [HPC-AI](https://www.hpc-ai.com/)

```sh
pip install -qU portkey-ai openai
```

### With OpenAI Client

```python
from openai import OpenAI
from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders

client = OpenAI(
api_key="YOUR_HPC_AI_API_KEY",
base_url=PORTKEY_GATEWAY_URL,
default_headers=createHeaders(
provider="hpc-ai",
api_key="YOUR_PORTKEY_API_KEY",
),
)

chat_complete = client.chat.completions.create(
model="minimax/minimax-m2.5",
messages=[{"role": "user", "content": "Who are you?"}],
)

print(chat_complete.choices[0].message.content)
```

### Observability

Routing through Portkey lets you track tokens, latency, cost, and more in the Portkey dashboard.

For the full integration page (Model Catalog, cURL, and SDK examples), see [/integrations/llms/hpc-ai](/integrations/llms/hpc-ai).
4 changes: 4 additions & 0 deletions integrations/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ description: "Portkey connects with all major LLM providers and orchestration fr
<Frame><img src="/images/supported-llm/groq.avif" alt="Groq" /></Frame>
</Card>

<Card title="HPC-AI" href="/integrations/llms/hpc-ai">
<Frame><img src="https://company.hpc-ai.com/hubfs/logos/colossal-ai_logo_vertical.svg" alt="HPC-AI" /></Frame>
</Card>

<Card title="Jina AI" href="/integrations/llms/jina-ai">
<Frame><img src="/images/supported-llm/jina.png" alt="Jina AI" /></Frame>
</Card>
Expand Down
166 changes: 166 additions & 0 deletions integrations/llms/hpc-ai.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
title: "HPC-AI"
description: "Integrate HPC-AI Model APIs (OpenAI-compatible) with Portkey's AI Gateway"
---

Portkey provides a gateway to [HPC-AI](https://www.hpc-ai.com/) **Model APIs**, which expose an **OpenAI-compatible** HTTP API for chat completions.

With Portkey, use fast routing, observability, prompt management, and secure API keys through [Model Catalog](/product/model-catalog).

## Quick Start

Get HPC-AI working in 3 steps:

<CodeGroup>
```python Python icon="python"
from portkey_ai import Portkey

# 1. Install: pip install portkey-ai
# 2. Add @hpc-ai provider in model catalog
# 3. Use it:

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.chat.completions.create(
model="@hpc-ai/minimax/minimax-m2.5",
messages=[{"role": "user", "content": "Say this is a test"}]
)

print(response.choices[0].message.content)
```

```js Javascript icon="square-js"
import Portkey from 'portkey-ai'

// 1. Install: npm install portkey-ai
// 2. Add @hpc-ai provider in model catalog
// 3. Use it:

const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY"
})

const response = await portkey.chat.completions.create({
model: "@hpc-ai/minimax/minimax-m2.5",
messages: [{ role: "user", content: "Say this is a test" }]
})

console.log(response.choices[0].message.content)
```

```python OpenAI Py icon="python"
from openai import OpenAI
from portkey_ai import PORTKEY_GATEWAY_URL

# 1. Install: pip install openai portkey-ai
# 2. Add @hpc-ai provider in model catalog
# 3. Use it:

client = OpenAI(
api_key="PORTKEY_API_KEY", # Portkey API key
base_url=PORTKEY_GATEWAY_URL
)

response = client.chat.completions.create(
model="@hpc-ai/minimax/minimax-m2.5",
messages=[{"role": "user", "content": "Say this is a test"}]
)

print(response.choices[0].message.content)
```

```js OpenAI JS icon="square-js"
import OpenAI from "openai"
import { PORTKEY_GATEWAY_URL } from "portkey-ai"

// 1. Install: npm install openai portkey-ai
// 2. Add @hpc-ai provider in model catalog
// 3. Use it:

const client = new OpenAI({
apiKey: "PORTKEY_API_KEY", // Portkey API key
baseURL: PORTKEY_GATEWAY_URL
})

const response = await client.chat.completions.create({
model: "@hpc-ai/minimax/minimax-m2.5",
messages: [{ role: "user", content: "Say this is a test" }]
})

console.log(response.choices[0].message.content)
```

```sh cURL icon="square-terminal"
# 1. Add @hpc-ai provider in model catalog
# 2. Use it:

curl https://api.portkey.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-d '{
"model": "@hpc-ai/minimax/minimax-m2.5",
"messages": [
{ "role": "user", "content": "Say this is a test" }
]
}'
```
</CodeGroup>

<Note>
**Tip:** You can also set `provider="@hpc-ai"` in `Portkey()` and use `model="minimax/minimax-m2.5"` or `model="moonshotai/kimi-k2.5"` in the request.
</Note>

## Open-source AI Gateway

When self-hosting the [Portkey AI Gateway](https://github.com/Portkey-AI/gateway), set `x-portkey-provider: hpc-ai` and `Authorization: Bearer <HPC_AI_API_KEY>`. The default upstream base URL is `https://api.hpc-ai.com/inference/v1`. Override it with `x-portkey-custom-host` or `custom_host` in your config when needed.

## Add Provider in Model Catalog

1. Go to [**Model Catalog → Add Provider**](https://app.portkey.ai/model-catalog/providers)
2. Select **HPC-AI** (when listed) or add credentials for provider slug `hpc-ai`
3. Enter your HPC-AI API key from the [HPC-AI console](https://www.hpc-ai.com/)
4. Name your provider (e.g., `hpc-ai-prod`)

<Card title="Complete Setup Guide →" href="/product/model-catalog">
See all setup options, code examples, and detailed instructions
</Card>

## Supported Endpoints

| Endpoint | Supported |
|----------|-----------|
| `/chat/completions` | ✅ |

Other OpenAI-compatible endpoints may be added as the gateway integration expands.

## Supported Models

Examples available through this integration:

- `minimax/minimax-m2.5`
- `moonshotai/kimi-k2.5`

<Card title="HPC-AI — Model APIs & docs" icon="link" href="https://www.hpc-ai.com/">
Product home, pricing, and developer documentation
</Card>

## Next Steps

<CardGroup cols={2}>
<Card title="Add Metadata" icon="tags" href="/product/observability/metadata">
Add metadata to your HPC-AI requests
</Card>
<Card title="Gateway Configs" icon="gear" href="/product/ai-gateway/configs">
Add gateway configs to your requests
</Card>
<Card title="Tracing" icon="chart-line" href="/product/observability/traces">
Trace your requests
</Card>
<Card title="Fallbacks" icon="arrow-rotate-left" href="/product/ai-gateway/fallbacks">
Set up fallbacks across providers
</Card>
</CardGroup>

<Card title="SDK Reference" icon="code" href="/api-reference/sdk/list">
Complete Portkey SDK documentation
</Card>
2 changes: 1 addition & 1 deletion openapi/portkey-models.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"/model-configs/pricing/{provider}/{model}": {
"get": {
"summary": "Get Model Pricing",
"description": "Returns pricing configuration for a specific model.\n\n**Note:** Prices are in USD cents per token.\n\n## Supported Providers\n\nopenai, anthropic, google, azure-openai, bedrock, mistral-ai, cohere, together-ai, groq, deepseek, fireworks-ai, perplexity-ai, anyscale, deepinfra, cerebras, x-ai, and 25+ more.\n\n## Response Fields\n\n| Field | Description | Unit |\n|-------|-------------|------|\n| `request_token.price` | Input token cost | cents/token |\n| `response_token.price` | Output token cost | cents/token |\n| `cache_write_input_token.price` | Cache write cost | cents/token |\n| `cache_read_input_token.price` | Cache read cost | cents/token |\n| `additional_units.*` | Provider-specific features | cents/unit |",
"description": "Returns pricing configuration for a specific model.\n\n**Note:** Prices are in USD cents per token.\n\n## Supported Providers\n\nopenai, anthropic, google, azure-openai, bedrock, mistral-ai, cohere, together-ai, groq, deepseek, fireworks-ai, perplexity-ai, anyscale, deepinfra, hpc-ai, cerebras, x-ai, and 25+ more.\n\n## Response Fields\n\n| Field | Description | Unit |\n|-------|-------------|------|\n| `request_token.price` | Input token cost | cents/token |\n| `response_token.price` | Output token cost | cents/token |\n| `cache_write_input_token.price` | Cache write cost | cents/token |\n| `cache_read_input_token.price` | Cache read cost | cents/token |\n| `additional_units.*` | Provider-specific features | cents/unit |",
"operationId": "getModelPricing",
"tags": ["Pricing"],
"parameters": [
Expand Down
4 changes: 2 additions & 2 deletions product/model-catalog/portkey-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ GET https://api.portkey.ai/model-configs/pricing/{provider}/{model}
<ParamField path="provider" type="string" required>
Provider identifier. Use lowercase with hyphens.

Examples: `openai`, `anthropic`, `google`, `azure-openai`, `bedrock`, `together-ai`, `groq`, `deepseek`, `x-ai`, `mistral-ai`, `cohere`, `fireworks-ai`, `perplexity-ai`, `anyscale`, `deepinfra`, `cerebras`
Examples: `openai`, `anthropic`, `google`, `azure-openai`, `bedrock`, `together-ai`, `groq`, `deepseek`, `x-ai`, `mistral-ai`, `cohere`, `fireworks-ai`, `perplexity-ai`, `anyscale`, `deepinfra`, `hpc-ai`, `cerebras`
</ParamField>

<ParamField path="model" type="string" required>
Expand Down Expand Up @@ -456,7 +456,7 @@ Use this endpoint to discover all available models and their pricing for a provi
<ParamField path="provider" type="string" required>
Provider identifier. Use lowercase with hyphens.

Examples: `openai`, `anthropic`, `google`, `bedrock`, `azure-openai`, `together-ai`, `groq`, `deepseek`, `x-ai`, `mistral-ai`
Examples: `openai`, `anthropic`, `google`, `bedrock`, `azure-openai`, `together-ai`, `groq`, `deepseek`, `x-ai`, `mistral-ai`, `hpc-ai`
</ParamField>

#### Response Schema
Expand Down