Skip to main content

Documentation Index

Fetch the complete documentation index at: https://portkey-docs-feat-byteplus-provider.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Portkey provides a robust and secure gateway to integrate various Large Language Models (LLMs) into applications, including BytePlus 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.
Provider Slug: byteplus

Quick Start

Get BytePlus ModelArk working in 3 steps:
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)
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
  2. Select BytePlus
  3. Choose existing credentials or create new by entering your BytePlus API key
  4. Name your provider (e.g., byteplus-prod)

Configuration Parameters

ParameterDescriptionRequired
apiKeyBytePlus ModelArk API keyYes
byteplusRegionRegion 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 β†’

See all setup options, code examples, and detailed instructions

Supported Endpoints

EndpointSupport
/chat/completionsSupported
/embeddingsSupported (multimodal)
/images/generationsSupported
/responsesSupported

Supported Features

FeatureSupport
Thinking/ReasoningSupported via thinking parameter
StreamingSupported

Embeddings

Generate multimodal embeddings using BytePlus ModelArk:
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])

Image Generation

Generate images using BytePlus ModelArk image models:
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)

Additional Image Generation Parameters

BytePlus supports additional parameters for image generation:
ParameterDescription
negative_promptText describing what to exclude from the image
guidance_scaleHow closely to follow the prompt (1-10)
seedSeed for reproducible generation (-1 to 2147483647)
width / heightImage dimensions
watermarkAdd watermark to generated images

Responses API

Use the OpenAI Responses API format with BytePlus models:
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)

Responses API reference

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:
RegionBase URL
ap-southeast-1 (default)https://ark.ap-southeast.bytepluses.com/api/v3
eu-west-1https://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.

Next Steps

Add Metadata

Add metadata to your BytePlus requests

Gateway Configs

Add gateway configs to your BytePlus requests

Tracing

Trace your BytePlus requests

Fallbacks

Setup fallback strategies with BytePlus
For complete SDK documentation:

SDK Reference

Complete Portkey SDK documentation
Last modified on May 24, 2026