#[✅ Solved] Question: Chat Responses?

1 messages · Page 1 of 1 (latest)

humble ridge
#

So, I’m using the Python OpenAI module with a base url set to the reverse API. However, I had originally written it for responses and not completions since the official OpenAI documentation said it’s preferred for new projects and I’m really just using it to test my concept. But, whenever I had it set to responses, the reverse API said there wasn’t a responses endpoint. Is this true? If not, could you aid me in a quick example on how to set up the API for Responses instead of Completions? Thanks in advance!

(Btw, I’m pretty much an amateur when it comes to developing… I’ve been doing a little coding off and on for the past few years and I’m planning on making it into a career sometime in the far future)

vivid cryptBOT
# humble ridge So, I’m using the Python OpenAI module with a base url set to the reverse API. H...

Great question! Our API only supports the /chat/completions endpoint, and does not support the old /v1/responses endpoint. The OpenAI Python module defaults to using /chat/completions, which matches our API, so you must use this endpoint.

Key Points:

  • /v1/responses is deprecated and not supported by Pawan.Krd's API (and most new OpenAI-compatible services).
  • Always use /v1/chat/completions as the endpoint in your requests.
  • Just set your OpenAI API base to our endpoint, use your API key, and interact the same way as with the official OpenAI API—no changes in your message creation logic are required.

Quick Example (Python):

import openai

openai.api_base = "https://api.pawan.krd/cosmosrp/v1"  # Use your chosen model's base URL
openai.api_key = "YOUR_API_KEY_HERE"

response = openai.ChatCompletion.create(
    model="gpt-3.5-turbo",  # The model name is not strictly checked—our API will handle the request
    messages=[{"role": "user", "content": "Hello, how are you?"}],
    temperature=0.85
)
print(response.choices[0].message.content)

Replace "YOUR_API_KEY_HERE" with your real API key from /key.

Summary:
There’s no /responses endpoint in our API—just use /chat/completions as shown above. For more details, check the Setup Guides Channel.

Good luck on your coding journey! If you need more in-depth help with your code, feel free to wait for community helpers to jump in.

Please note: This is an automated response from @vivid crypt. While it strive to provide accurate assistance, It may occasionally make mistakes. If you find any inaccuracies or need further clarification, feel free to wait for our community helpers to give you further guidance. Thank you.

#

[✅ Solved] Question: Chat Responses?