# Initialize the OpenAI client with BytePlus base URL
client = OpenAI(
    base_url="https://ark.ap-southeast.bytepluses.com/api/v3",
    api_key="YOUR_BYTEPLUS_API_KEY"
)
client = track_openai(client)

response = client.chat.completions.create(
    model="kimi-k2-250711",  # You can use any model available on BytePlus
    messages=[
        {"role": "user", "content": "Hello, world!"}
    ],
    temperature=0.7,
    max_tokens=100
)

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

## Advanced Usage

### Using with @track decorator

You can combine the tracked client with Opik's `@track` decorator for comprehensive tracing:

```python
from opik import track
from opik.integrations.openai import track_openai
from openai import OpenAI

client = OpenAI(
    base_url="https://ark.ap-southeast.bytepluses.com/api/v3",
    api_key="YOUR_BYTEPLUS_API_KEY"
)
client = track_openai(client)

@track
def analyze_data_with_ai(query: str):
    """Analyze data using BytePlus AI models."""

    response = client.chat.completions.create(
        model="kimi-k2-250711",
        messages=[
            {"role": "user", "content": query}
        ]
    )

    return response.choices[0].message.content