O1-preview not working in API (tier 1)

Hi, I’ve received the invitation to use o1-preview in the API. However, I encounter an error and am not sure what’s missing.

completion = client.chat.completions.create(
    model = "o1-preview", 
    messages=[
        {"role": "system", "content": system_prompt + content_prompt},
        {"role": "user", "content": user_prompt}
    ]
)

My error is this:

openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: “Unsupported value: ‘messages[0].role’ does not support ‘system’ with this model.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages[0].role’, ‘code’: ‘unsupported_value’}}

We don’t support system prompts with o1 yet! (But we’re working on it.)

1 Like

Thank you, I was able to get it to work by eliminating the system prompt.

completion = client.chat.completions.create(
    model = "o1-preview", 
    messages=[
        {"role": "user", "content": system_prompt + content_prompt + user_prompt}
    ]
)
2 Likes