[Python] How is the compatibility between CometAPI and OpenAI SDK?

Discussão em 'Python' iniciado por Stack, Setembro 12, 2025.

  1. Stack

    Stack Membro Participativo

    In my project, I'm using OpenAI's official Python SDK, and I'm trying to change the base_url to CometAPI's address:

    import openai

    client = openai.OpenAI(
    api_key="my_key",
    base_url="https://api.cometapi.com/v1"
    )

    resp = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello"}]
    )


    Has anyone used CometAPI in a production environment for a long time? How is its compatibility and stability performance?

    Continue reading...

Compartilhe esta Página