POST
/
talk-to-gpt
curl --request POST \
  --url https://nano-gpt.com/api/talk-to-gpt \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "prompt": "Please explain the concept of artificial intelligence.",
  "model": "chatgpt-4o-latest",
  "messages": [
    {
      "role": "user",
      "content": "Hi, I'\''m just testing!"
    }
  ]
}'
"<string>"

Authorizations

x-api-key
string
header
required

Body

application/json
Parameters for talking to GPT
model
string
default:chatgpt-4o-latest
required

The model to use for generation

prompt
string
default:

The text prompt to send to GPT (optional)

Example:

"Please explain the concept of artificial intelligence."

messages
object[]

Array of previous message objects for context (optional)

Response

200
text/plain
Talk to GPT response

Text response followed by metadata in <NanoGPT> tags