> ## 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 Portkey's AI Gateway

Portkey 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 Portkey, take advantage of features like fast AI gateway access, observability, prompt management, and more, while securely managing API keys through [Model Catalog](https://docs.portkey.ai/docs/product/model-catalog.md).

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

## Quick Start

Get BytePlus ModelArk working in 3 steps:

```python Python icon="python" theme={"system"}
from portkey_ai import Portkey

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

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.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 Javascript icon="square-js" theme={"system"}
import Portkey from 'portkey-ai'

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

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

const response = await portkey.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)
```

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

# 1. Install: pip install openai portkey-ai
# 2. Add @byteplus 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="@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"
import { PORTKEY_GATEWAY_URL } from "portkey-ai"

// 1. Install: npm install openai portkey-ai
// 2. Add @byteplus 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: "@byteplus/ep-m-your-endpoint-id",
    messages: [{ role: "user", content: "Say this is a test" }]
})

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

```sh cURL icon="square-terminal" theme={"system"}
# 1. Add @byteplus 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": "@byteplus/ep-m-your-endpoint-id",
    "messages": [
      { "role": "user", "content": "Say this is a test" }
    ]
  }'
```

> [!NOTE]
>
> **Tip:** You can also set `provider="@byteplus"` in `Portkey()` 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://app.portkey.ai/model-catalog/providers)
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.

> [card] [Complete Setup Guide →](https://docs.portkey.ai/docs/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:

```python Python theme={"system"}
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.embeddings.create(
    model="@byteplus/ep-m-your-embedding-endpoint",
    input="The quick brown fox jumps over the lazy dog"
)

print(response.data[0].embedding[:5])
```

```js Javascript theme={"system"}
import Portkey from 'portkey-ai'

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

const response = await portkey.embeddings.create({
    model: "@byteplus/ep-m-your-embedding-endpoint",
    input: "The quick brown fox jumps over the lazy dog"
})

console.log(response.data[0].embedding.slice(0, 5))
```

```sh cURL theme={"system"}
curl https://api.portkey.ai/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: $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:

```python Python theme={"system"}
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

image = portkey.images.generate(
    model="@byteplus/ep-m-your-image-endpoint",
    prompt="A serene landscape with mountains and a lake at sunset",
    size="1024x1024"
)

print(image.data[0].url)
```

```js Javascript theme={"system"}
import Portkey from 'portkey-ai'

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

const image = await portkey.images.generate({
    model: "@byteplus/ep-m-your-image-endpoint",
    prompt: "A serene landscape with mountains and a lake at sunset",
    size: "1024x1024"
})

console.log(image.data[0].url)
```

```sh cURL theme={"system"}
curl https://api.portkey.ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: $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:

```python Python theme={"system"}
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.responses.create(
    model="@byteplus/ep-m-your-endpoint-id",
    input="Tell me a three sentence bedtime story about a unicorn."
)

print(response)
```

```js Javascript theme={"system"}
import Portkey from 'portkey-ai'

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

const response = await portkey.responses.create({
    model: "@byteplus/ep-m-your-endpoint-id",
    input: "Tell me a three sentence bedtime story about a unicorn."
})

console.log(response)
```

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

> [card] [Responses API reference](https://docs.portkey.ai/docs/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

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

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

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

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

For complete SDK documentation:

> [card] [SDK Reference](https://docs.portkey.ai/docs/api-reference/sdk/list.md)
>
> Complete Portkey SDK documentation

***

> [card] [Portkey is now PRISMA AIRS AI Gateway. See it in action.](https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\&utm_medium=referral\&utm_campaign=prisma_airs\&utm_content=docs_nav#contact)
>
> Contact Us


## Related topics

- [May](https://docs.portkey.ai/docs/changelog/2026/may.md)
- [Backend](https://docs.portkey.ai/docs/changelog/backend.md)
- [Frontend](https://docs.portkey.ai/docs/changelog/frontend.md)
- [Portkey Models](https://docs.portkey.ai/docs/product/model-catalog/portkey-models.md)
- [Update Model Access](https://docs.portkey.ai/docs/api-reference/admin-api/control-plane/integrations/models/update-model-access.md)


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