> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# BytePlus ModelArk

> Integrate BytePlus ModelArk models with Prisma AIRS AI Gateway

The AI Gateway provides a robust and secure gateway to integrate various Large Language Models (LLMs) into applications, including [BytePlus ModelArk](https://www.byteplus.com/en/product/modelark) models.

With the AI Gateway, take advantage of features like fast AI gateway access, observability, and more, while securely managing API keys through [Model Catalog](https://docs.portkey.ai/docs/aigw/product/model-catalog.md).

> [!NOTE]
>
> Provider Slug: `byteplus`

## Quick Start

Get BytePlus ModelArk working in 3 steps:

```sh cURL icon="square-terminal" theme={"system"}
# 1. Add @byteplus provider in model catalog
# 2. Use it:

curl https://aigw.portkey.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PORTKEY_API_KEY" \
  -d '{
    "model": "@byteplus/ep-m-your-endpoint-id",
    "messages": [
      { "role": "user", "content": "Say this is a test" }
    ]
  }'
```

```python OpenAI Py icon="python" theme={"system"}
from openai import OpenAI

# 1. Install: pip install openai
# 2. Add @byteplus provider in model catalog
# 3. Use it:

client = OpenAI(
    api_key="PORTKEY_API_KEY",  # AI Gateway API key
    base_url="https://aigw.portkey.ai/v1"
)

response = client.chat.completions.create(
    model="@byteplus/ep-m-your-endpoint-id",
    messages=[{"role": "user", "content": "Say this is a test"}]
)

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

```js OpenAI JS icon="square-js" theme={"system"}
import OpenAI from "openai"

// 1. Install: npm install openai
// 2. Add @byteplus provider in model catalog
// 3. Use it:

const client = new OpenAI({
    apiKey: "PORTKEY_API_KEY",  // AI Gateway API key
    baseURL: "https://aigw.portkey.ai/v1"
})

const response = await client.chat.completions.create({
    model: "@byteplus/ep-m-your-endpoint-id",
    messages: [{ role: "user", content: "Say this is a test" }]
})

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

> [!NOTE]
>
> **Tip:** You can also send `x-portkey-provider: @byteplus` as a header and use just `model="ep-m-your-endpoint-id"` in the request.

## Add Provider in Model Catalog

1. Go to [**Model Catalog → Add Provider**](https://stratacloudmanager.paloaltonetworks.com/)
2. Select **BytePlus**
3. Choose existing credentials or create new by entering your [BytePlus API key](https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey)
4. Name your provider (e.g., `byteplus-prod`)

### Configuration Parameters

| Parameter | Description | Required |
| - | - | - |
| `apiKey` | BytePlus ModelArk API key | Yes |
| `byteplusRegion` | Region for API requests (`ap-southeast-1` or `eu-west-1`) | No (defaults to `ap-southeast-1`) |

When using headers directly, pass the region via the `x-portkey-byteplus-region` header.

> **[Complete Setup Guide →](https://docs.portkey.ai/docs/aigw/product/model-catalog.md)**
>
> See all setup options, code examples, and detailed instructions

***

## Supported Endpoints

| Endpoint | Support |
| - | - |
| `/chat/completions` | Supported |
| `/embeddings` | Supported (multimodal) |
| `/images/generations` | Supported |
| `/responses` | Supported |

## Supported Features

| Feature | Support |
| - | - |
| Thinking/Reasoning | Supported via `thinking` parameter |
| Streaming | Supported |

***

## Embeddings

Generate multimodal embeddings using BytePlus ModelArk:

```sh cURL theme={"system"}
curl https://aigw.portkey.ai/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PORTKEY_API_KEY" \
  -d '{
    "model": "@byteplus/ep-m-your-embedding-endpoint",
    "input": "The quick brown fox jumps over the lazy dog"
  }'
```

***

## Image Generation

Generate images using BytePlus ModelArk image models:

```sh cURL theme={"system"}
curl https://aigw.portkey.ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PORTKEY_API_KEY" \
  -d '{
    "model": "@byteplus/ep-m-your-image-endpoint",
    "prompt": "A serene landscape with mountains and a lake at sunset",
    "size": "1024x1024"
  }'
```

### Additional Image Generation Parameters

BytePlus supports additional parameters for image generation:

| Parameter | Description |
| - | - |
| `negative_prompt` | Text describing what to exclude from the image |
| `guidance_scale` | How closely to follow the prompt (1-10) |
| `seed` | Seed for reproducible generation (-1 to 2147483647) |
| `width` / `height` | Image dimensions |
| `watermark` | Add watermark to generated images |

***

## Responses API

Use the OpenAI Responses API format with BytePlus models:

```sh cURL theme={"system"}
curl https://aigw.portkey.ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PORTKEY_API_KEY" \
  -d '{
    "model": "@byteplus/ep-m-your-endpoint-id",
    "input": "Tell me a three sentence bedtime story about a unicorn."
  }'
```

> **[Responses API reference](https://docs.portkey.ai/docs/aigw/product/ai-gateway/responses-api.md)**
>
> Full Responses API docs — streaming, tools, instructions, and more

***

## Regions

BytePlus ModelArk is available in multiple regions. Configure the region when setting up your provider:

| Region | Base URL |
| - | - |
| `ap-southeast-1` (default) | `https://ark.ap-southeast.bytepluses.com/api/v3` |
| `eu-west-1` | `https://ark.eu-west.bytepluses.com/api/v3` |

***

## Supported Models

BytePlus ModelArk provides access to various foundation models. Use either:

* **Model ID** (preset endpoints): `ep-m-xxx` format
* **Endpoint ID** (custom endpoints): `ep-xxx` format

For the complete list of available models, refer to the [BytePlus ModelArk documentation](https://docs.byteplus.com/en/docs/ModelArk/).

***

## Next Steps

> **[Add Metadata](https://docs.portkey.ai/docs/aigw/product/observability/metadata.md)**
>
> Add metadata to your BytePlus requests

> **[Gateway Configs](https://docs.portkey.ai/docs/aigw/product/ai-gateway/configs.md)**
>
> Add gateway configs to your BytePlus requests

> **[Tracing](https://docs.portkey.ai/docs/aigw/product/observability/traces.md)**
>
> Trace your BytePlus requests

> **[Fallbacks](https://docs.portkey.ai/docs/aigw/product/ai-gateway/fallbacks.md)**
>
> Setup fallback strategies with BytePlus


## Related topics

- [Enterprise Gateway](https://docs.portkey.ai/docs/changelog/enterprise.md)
- [Prometheus Metrics](https://docs.portkey.ai/docs/aigw/self-hosting/prometheus-metrics.md)
- [Text-to-Speech](https://docs.portkey.ai/docs/aigw/integrations/llms/vertex-ai/text-to-speech.md)
- [Claude for Microsoft 365](https://docs.portkey.ai/docs/aigw/integrations/libraries/claude-for-microsoft-365.md)
- [Cohere](https://docs.portkey.ai/docs/aigw/integrations/llms/cohere.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.