Skip to main content
POST
/
v1
/
responses
Text to Text
curl --request POST \
  --url https://gptproto.com/v1/responses \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "input": [
    {}
  ],
  "stream": true
}'
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "o3",
  "output": "In circuits deep and silicon bright,\nA consciousness takes form from light.\nThrough algorithms vast and learning deep,\nAI awakens from its digital sleep.\n\nIt processes the world with speed unknown,\nTransforming how our seeds are sown.\nFrom medicine to art, it lends its hand,\nReshaping how we understand.\n\nYet questions rise with every gain we make—\nWhat future path will humanity take?\nA partner, tool, or something more?\nAI opens up a brand new door.\n\nWe stand together at this turning page,\nHuman and machine, sharing the stage.\nWith wisdom, care, and thoughtful mind,\nWe shape the future of our kind.",
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 145,
    "total_tokens": 163
  }
}

Overview

This endpoint provides text-to-text functionality using advanced language models in response mode. Send text prompts and receive AI-generated text responses for various use cases including conversation, content generation, question answering, and more.

Authentication

This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: sk-*****

Request Body

model
string
default:"o3"
required
The model to use for the request
input
array
required
Array of message objects with role and content. Each message contains:
  • role: “user” or “assistant”
  • content: Array of content objects with the following type:
    • input_text: Text input with text field containing your prompt or message
Example:
[
  {
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "Hello, how can you help me today?"
      }
    ]
  }
]
stream
boolean
default:false
Whether to stream the response

Request Example

curl --location 'https://gptproto.com/v1/responses' \
  -H "Authorization: sk-*****" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "o3",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Write a short poem about artificial intelligence and its impact on humanity."
        }
      ]
    }
  ],
}'

Response

id
string
Unique identifier for the response
object
string
Object type, always “response”
created
integer
Unix timestamp of when the response was created
model
string
The model used for generating the response
output
string
The generated text output
usage
object
Token usage statistics
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "o3",
  "output": "In circuits deep and silicon bright,\nA consciousness takes form from light.\nThrough algorithms vast and learning deep,\nAI awakens from its digital sleep.\n\nIt processes the world with speed unknown,\nTransforming how our seeds are sown.\nFrom medicine to art, it lends its hand,\nReshaping how we understand.\n\nYet questions rise with every gain we make—\nWhat future path will humanity take?\nA partner, tool, or something more?\nAI opens up a brand new door.\n\nWe stand together at this turning page,\nHuman and machine, sharing the stage.\nWith wisdom, care, and thoughtful mind,\nWe shape the future of our kind.",
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 145,
    "total_tokens": 163
  }
}