Battle tested in production, our API offers the most cost effective and reliable solutions for your AI needs.
$0.00000001 /1000 tokens
Our API is designed to be simple and easy to use. We offer two endpoints for text generation. One endpoint uses query parameters, and the other uses a JSON body.
Our API is hosted at https://api.gpt-research.org
Note: if you want to use a custom model from a hosted GPT-Research Hub, your custom API endpoint will be shown on the model's page.
Endpoint to perform text generation using a prompt and model.
curl -X POST \
-H "Content-Type: application/json" \
-d '{"prompt":"Your prompt text here", "model":"ModelName"}' \
https://api.gpt-research.org/api/v1/inference
fetch('https://api.gpt-research.org/api/v1/inference', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ prompt: 'Your prompt text here', model: 'ModelName' })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"result": "Generated text here"
}
Endpoint to perform text generation using a prompt and model via query parameters.
curl -X GET \
"https://api.gpt-research.org/api/v1/inference?prompt=Your+prompt+text+here&model=ModelName"
fetch('https://api.gpt-research.org/api/v1/inference?prompt=Your+prompt+text+here&model=ModelName')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"result": "Generated text here"
}
To use our API for commercial purposes, please contact us at team@gpt-research.org