Use for questions about the OpenAI ChatGPT (i.e., GPT-3.5) API. Do not use it for questions about any other OpenAI API (GPT-3, GPT-4, etc.).
Questions tagged [chatgpt-api]
377 questions
1
vote
0 answers
Failed to load message due to okhttp3.internal.http.RealResponseBody
I am trying to implement chatgpt into my android application.
When I send a message to chatgpt it replies to me with the error "Failed to load message due to okhttp3.internal.http.RealResponseBody"
This is code I am using:
public class GPTActivity…

THE BUILDER
- 11
- 1
1
vote
0 answers
Extracting and Displaying Prompts Sent to OpenAI API via Various Frameworks
I'm currently working on debugging an application which uses the Langchain library, a Python-based language model library/framework. The application also uses the OpenAI Python client library to send requests to the OpenAI API.
During my debugging…

washingweb
- 108
- 5
1
vote
0 answers
Replacing UI with LLMs
How can one replace the UI of an application with an LLM's chat window? The bot should be able to do everything it used to but via natural language. So the end user doesn't have to click at buttons or view options in a menu; rather, he/she should be…

theodre7
- 125
- 4
1
vote
1 answer
OpenAI API: How do I handle errors in Python?
I tried using the below code, but the OpenAI API doesn't have the AuthenticationError method in the library. How can I effectively handle such error.
import openai
# Set up your OpenAI credentials
openai.api_key = 'YOUR_API_KEY'
try:
# Perform…

benjamin olise
- 95
- 1
- 7
1
vote
3 answers
Easiest way to hide api key using Next.js and Vercel?
I am buidling an app that uses OpenAI's API (with Next.js and Vercel). In order to make it work, I can let the frontend make the API call directly. However, doing so will expose the API key to the browser (I know it's never safe to store secrets in…

William Jin
- 21
- 1
1
vote
0 answers
How do I resolve the 'Import openai could not be resolved' error in Visual Studio Code when creating a custom chat GPT bot?
I'm trying to make a custom ChatGPT bot in Visual Studio Code and I'm getting the error Import "OpenAI" could not be resolved Pylance(reportMissingImports) the error code is reportMissingImports [boolean or string, optional]: Generate or suppress…

Liam Whitsitt
- 11
- 1
1
vote
0 answers
GPT Commit Generator for Visual Studio 2022
There are cool Visual Studio Code extensions for generating automatic commit messages using ChatGPT API. Like…

esege
- 51
- 6
1
vote
2 answers
Error in integration of ChatGPT API in SAS. Invalid context type header
I would like to integrate chatgpt into sas, but when I execute the code I get the error shown in the image.
The error message that is shown is> Invalid-COntent Type header. Expexted application/json.
%let chatgpt_api_token =…

stat
- 23
- 3
1
vote
0 answers
Generic Answer when Fine Tuning OpenAI Model
I have prepared a dataset and trained a davinci model using FineTuning. It gives out the correct answer for any variant of questions that exist in the dataset.
But how to fine tune the model to give out something like a "Sorry I do not know the…

3e4r5t
- 21
- 3
1
vote
2 answers
how can I count tokens before making api call?
import { Configuration, OpenAIApi } from "openai"
import { readFile } from './readFile.js'
// Config OpenAI API
const configuration = new Configuration({
organization: "xyx......",
apiKey: "abc.......",
});
// OpenAI API instance
export…

Sorab
- 33
- 4
1
vote
0 answers
Nodejs OpenAI ChatGPT API error 400 without error
i am trying to use official openai nodejs with my backend, but i keep getting 400 empty error.. i am check the api key but still getting error,
here is my code
implementation
export class ChatGPTServiceImplemnt implements ChatGPTService {
async…

Gbenga B Ayannuga
- 2,407
- 3
- 17
- 38
1
vote
0 answers
OpenAI API: AxiosError: Request failed with status code 401
I'm trying to use OpenAI's API to generate recipes for a website, but
I keep getting the error in the title
code:
const handleGenerateRecipe = async () => {
try {
const response = await axios.post("https://api.openai.com/v1/completions",…

Brandon
- 11
- 2
1
vote
1 answer
What model is used for the free version of ChatGPT?
The ChatGPT Plus version offers GPT-3.5 Turbo and GPT-4, and I was able to easily find official documentation about them.
So what are the model versions used in the free version of ChatGPT? I see it says text-davinci-002-render-sha, so is that…

Myung-Gyo Oh
- 11
- 2
1
vote
0 answers
ChatGPT plugin render markdown syntax
How to ask the ChatGPT plugin properly request and render with Markdown? I see Speak plugin does this in request and returns in customized markdown. How does ChatGPT know how to request and render the customized markdown response like…

angelokh
- 9,426
- 9
- 69
- 139
1
vote
1 answer
GPT4 - Unable to get response for a question?
As the title clearly describes the issue I've been experiencing, I'm not able to get a response to a question from the dataset I use using the nomic-ai/gpt4all. The execution simply stops. No exception occurs. How can I overcome this situation?
p.s.…

talha06
- 6,206
- 21
- 92
- 147