stream-chatgpt endpoint
Performs a managed ChatGPT API request to create an streaming endpoint.
Last updated
Performs a managed ChatGPT API request to create an streaming endpoint.
Last updated
Performs an request generating custom endpoints in order to display the response status and send the stream output in format.
This endpoint is designed for sending streaming data. If this is not the case, it is recommended to use the .
The only required parameter -besides headers- is the messages
parameter. All other parameters refer to the default values of the Chat Completion API.
POST
https://offloadgpt.p.rapidapi.com/v1/stream-chatgpt
Content-Type
String
application/json
X-OpenAI-API-Key*
String
<Your OpenAI API key>
X-RapidAPI-Key*
String
<Your RapidAPI key>
X-RapidAPI-Host*
String
offloadgpt.p.rapidapi.com
access
string
Privacy of the generated endpoints: public
to be available for anyone, or private
to access only using a generated Bearer Token. Default is public
.
timeout
Number
The timeout of the request in seconds. Default value is 90 seconds. Max timeout allowed is 90 seconds.
connect_timeout
Number
The timeout to stablish connection with the OpenAI API. Default value is 5 seconds. Max connection timeout allowed is 10 seconds.
from_status_url
String
The Url of a previously generated status_url
. This allows to concatenate the previous messages with the new one sent in the current request.
from_bearer_token
String
In the case of setting a value to the from_status_url
argument, if this URL is private then it is necessary to provide its associated bearer_token
generated on the same request.
conversation_id
String
webhook_url
String
A external URL to send, using the POST method, with all the information processed. There is only one parameter called response
containing a JSON with the same information of the final status_url
response.
model
String
messages*
Array
temperature
Number
top_p
Number
n
Integer
max_tokens
Integer
stop
String or Array
presence_penalty
Number
frequency_penalty
Number
logit_bias
Map
user
String
from_max_length
Number
In the case of setting a value to the from_status_url
argument, here you can restrict the number of characters from the last response of the previous messages.
For a successful request, the response will look as follows, having a success
status:
We can see other properties such as created_at
, the conversation_id
(filled from the parameters or generated if missing), and the generated endpoints
property.
For private access requests, the response would look as follows:
Here we can see the following changes from the authorization
property:
The value of access
is now private
.
It provides a bearer_token
property.
Additionally there is a stream_url_arg
property.
In private requests, the generated endpoints can be accessed via GET requests using this header:
In case you are using the stream_events_url
from the Javascript EventSource object -which does not allow to add headers- you can grant access adding the stream_url_arg
property to the stream_events_url
endpoint:
While the request is active and has not finished, you can stop the streaming flow of data and terminate the request using the stop_url
endpoint.
It works as the same way as the other endpoints, so it is publicly accesible in case of public access, and needs the Authorization: Bearer
for private access.
If provided, any other conversation derived from this one will keep this conversation identifier. If not provided, a default id will be generated in .
Refers to the of the OpenAI Chat Completion API. If omitted, the default value is gpt-3.5-turbo
.
Refers to the of the OpenAI Chat Completion API. This is the only one required parameter.
Refers to the of the OpenAI Chat Completion API. Defaults to 1.
Refers to the of the OpenAI Chat Completion API. Defaults to 1.
Refers to the of the OpenAI Chat Completion API. Defaults to 1.
Refers to the of the OpenAI Chat Completion API. Defaults to inf.
Refers to the of the OpenAI Chat Completion API. Defaults to null.
Refers to the of the OpenAI Chat Completion API. Defaults to 0.
Refers to the of the OpenAI Chat Completion API. Defaults to 0.
Refers to the of the OpenAI Chat Completion API. Defaults to null.
Refers to the of the OpenAI Chat Completion API. Defaults to null.