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
1 change: 1 addition & 0 deletions components/icons/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export { default as OpenAIIcon } from './openai'
export { default as OpenRouterIcon } from './openrouter'
export { default as PerplexityIcon } from './perplexity'
export { default as PortkeyIcon } from './portkey'
export { default as PowerTokensIcon } from './powertokens'
export { default as RailwayIcon } from './railway'
export { default as RedisIcon } from './redis'
export { default as S3Icon } from './s3'
Expand Down
13 changes: 13 additions & 0 deletions components/icons/providers/powertokens.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'

export default function PowerTokensIcon({ className, ...props }: React.SVGProps<SVGSVGElement>) {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 935 935" className={className} {...props}>
<path
fill="currentColor"
fillRule="evenodd"
d="M 108.751 1.666 C 107.789 1.930, 106.763 3.126, 106.472 4.323 C 106.180 5.520, 106.080 138.575, 106.249 300 C 106.539 576.308, 106.660 593.925, 108.319 600.748 C 110.777 610.855, 116.384 623.800, 122.088 632.537 C 129.763 644.295, 148.730 663, 152.977 663 C 153.642 663, 157.857 659.579, 162.343 655.399 C 183.325 635.846, 220.211 616.203, 251.500 607.921 C 258.100 606.173, 264.291 603.998, 265.257 603.087 C 269.859 598.747, 269.964 595.580, 269.983 460.381 C 270.002 321.029, 269.859 324.665, 275.974 307.910 C 288.344 274.014, 314.772 250.984, 348.838 244.415 C 361.600 241.954, 536.402 242.387, 548.627 244.910 C 584.680 252.350, 616.110 280.959, 627.277 316.500 C 636.873 347.038, 632.149 379.984, 614.328 406.819 C 599.648 428.921, 580.768 442.364, 552.739 450.672 L 543.500 453.410 490.750 453.754 L 438 454.098 437.852 466.299 C 437.614 485.972, 437.606 494.606, 437.809 510.250 L 438 525 486.933 525 C 534.683 525, 536.189 524.940, 549.183 522.534 C 603.653 512.447, 648.654 482.660, 678.734 436.784 C 702.270 400.890, 710.199 356.180, 700.954 311.500 C 687.693 247.410, 637.152 193.859, 574.575 177.595 C 553.423 172.097, 552.284 172.046, 447.468 171.818 L 350.500 171.607 337.500 173.892 C 267.726 186.154, 215.654 237.545, 200.237 309.361 L 197.631 321.500 197.066 454.170 L 196.500 586.840 194.076 589.420 C 191 592.693, 186.990 592.755, 183.306 589.587 L 180.500 587.173 180 332.337 C 179.725 192.177, 179.801 76.554, 180.169 75.398 L 180.838 73.295 277.169 73.177 L 373.500 73.060 377.988 67.780 C 401.082 40.613, 426.647 21.118, 457.857 6.873 L 468.500 2.016 340.500 1.944 C 270.100 1.904, 189.550 1.718, 161.500 1.529 C 133.450 1.340, 109.713 1.402, 108.751 1.666 M 534 5.615 C 461.709 12.203, 401.818 52.042, 369.557 115 C 364.865 124.157, 357.643 142.953, 355.629 151.250 L 354.962 154 392.951 154 L 430.939 154 434.466 146.367 C 448.156 116.737, 475.907 92.940, 508.829 82.599 C 558.114 67.118, 625.263 83.306, 680 123.863 C 702.278 140.370, 728.952 169.332, 743.946 193.292 C 779.363 249.892, 793.216 320.128, 780.363 377.923 C 775.594 399.365, 763.041 429.993, 749.858 452.353 C 699.213 538.254, 630.232 588.459, 537.500 606.910 C 511.119 612.159, 509.582 612.231, 407 613.004 C 326.381 613.611, 308.854 613.992, 300.500 615.316 C 262.126 621.399, 224.762 633.762, 201.237 648.161 C 151.949 678.329, 123.974 725.381, 121.365 782.500 C 120.029 811.755, 131.181 846.217, 150.311 871.948 C 169.212 897.371, 191.669 914.323, 219.752 924.365 C 299.592 952.916, 385.050 910.571, 412.007 829.101 C 419.057 807.793, 419.443 803.607, 419.243 750.616 C 419.145 724.830, 418.938 703.614, 418.783 703.470 C 418.198 702.926, 349.144 702.525, 348.606 703.062 C 348.297 703.370, 347.872 724.070, 347.662 749.062 C 347.243 798.854, 346.863 802.608, 340.898 815.846 C 331.360 837.013, 309.501 855.103, 288 859.623 C 276.754 861.986, 257.107 861.042, 246.500 857.627 C 220.583 849.283, 199.296 824.252, 195.096 797.181 C 187.108 745.699, 225.819 702.852, 292.343 689.542 C 314.023 685.204, 319.633 685, 417.711 684.997 C 527.782 684.993, 535.602 684.522, 576.186 675.458 C 601.170 669.879, 609.414 667.071, 623.606 659.308 C 630.698 655.429, 643.700 648.331, 652.500 643.534 C 698.999 618.185, 742.721 582.407, 772.311 545.492 C 814.254 493.165, 848.556 421.569, 854.474 374 C 860.449 325.971, 854.887 268.796, 840.056 225.783 C 799.600 108.458, 699.096 24.020, 580.336 7.579 C 568.979 6.007, 542.171 4.871, 534 5.615 M 369.574 262.250 C 363.016 272.277, 352.326 304.130, 349.485 322.109 C 347.702 333.395, 345.961 562.259, 347.488 584.659 L 348.192 595 384.096 595 L 420 595 420 468.131 C 420 330.240, 419.859 334.062, 425.610 315.829 C 431.857 296.019, 445.926 276.077, 461.589 264.829 C 464.015 263.086, 466 261.287, 466 260.830 C 466 260.374, 444.635 260, 418.523 260 L 371.046 260 369.574 262.250"
/>
</svg>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"openrouter",
"perplexity",
"portkey",
"powertokens",
"shuttleai",
"togetherai",
"truefoundry",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: PowerTokens
icon: PowerTokens
description: Configure PowerTokens as a custom endpoint in LibreChat.
---

PowerTokens is an OpenAI-compatible gateway for GLM, MiniMax, Qwen and DeepSeek models. One API key works for every model.

## Get an API key

Create an account at [powertokens.ai](https://powertokens.ai/?utm_source=github&utm_medium=librechat&utm_campaign=librechat) and generate a key on the [API keys page](https://www.powertokens.ai/en/api-keys?utm_source=github&utm_medium=librechat&utm_campaign=librechat). Add it to your `.env` file:

```bash filename=".env"
POWERTOKENS_API_KEY=your-api-key
```

## Configuration

Add the endpoint under `endpoints.custom` in your `librechat.yaml`:

```yaml filename="librechat.yaml"
- name: "PowerTokens"
apiKey: "${POWERTOKENS_API_KEY}"
baseURL: "https://api.powertokens.ai/v1"
models:
default:
- "glm-5.2"
- "MiniMax-M3"
- "glm-5-turbo"
- "qwen3-coder-plus"
- "deepseek-v3-2-251201"
fetch: false
titleConvo: true
titleModel: "glm-5-turbo"
modelDisplayLabel: "PowerTokens"
```

To let each user supply their own key through the LibreChat UI instead of reading one from `.env`, set `apiKey: "user_provided"`.

## Notes

- Use model IDs exactly as they appear on the [PowerTokens models page](https://powertokens.ai/models?utm_source=github&utm_medium=librechat&utm_campaign=librechat).
- Set `fetch: true` to load the model list from the `/v1/models` endpoint instead of the fixed list above.
- Model details and request parameters are in the [PowerTokens docs](https://docs.powertokens.ai?utm_source=github&utm_medium=librechat&utm_campaign=librechat).
2 changes: 2 additions & 0 deletions lib/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
OpenRouterIcon,
PerplexityIcon,
PortkeyIcon,
PowerTokensIcon,
RailwayIcon,
RedisIcon,
S3Icon,
Expand Down Expand Up @@ -275,6 +276,7 @@ const icons: Record<string, ReactElement> = {
OpenRouter: <OpenRouterIcon />,
Perplexity: <PerplexityIcon />,
Portkey: <PortkeyIcon />,
PowerTokens: <PowerTokensIcon />,
Railway: <RailwayIcon />,
Redis: <RedisIcon />,
S3: <S3Icon />,
Expand Down