Code Examples

Use the OpenAI Python SDK to call this model. Replace your-api-key with your API key.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.ohmygpt.com/v1",
    api_key="your-api-key",  # Replace with your API key
)

response = client.chat.completions.create(
    model="TA/mistralai/Mixtral-8x7B-Instruct-v0.1",
    messages=[
        {"role": "user", "content": "Hello!"}
    ],
)

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