Skip to main content
POST
/
responses
curl --request POST \
  --url https://api.anyapi.ai/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4o",
  "input": "Tell me about AI"
}
'
{
  "id": "<string>",
  "object": "response",
  "created": 123,
  "model": "<string>",
  "content": "<string>",
  "conversation_id": "<string>",
  "tools_used": [
    {
      "type": "web_search",
      "result": {}
    }
  ],
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  },
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Get your API key from the dashboard.

Body

application/json
model
string
required

ID of the model to use

Example:

"gpt-4o"

input

Text input for the model

conversation

Conversation ID to continue an existing conversation

tools
object[]

List of tools available to the model

files
object[]

List of files to attach to the request

include
enum<string>[]

List of additional data to include in the response

Available options:
web_search,
file_search,
code_interpreter.outputs
max_tokens
integer

Maximum number of tokens to generate

Required range: x >= 1
temperature
number
default:1

Sampling temperature between 0 and 2

Required range: 0 <= x <= 2
stream
boolean
default:false

Whether to stream the response

background
boolean
default:false

Process request in background and notify via webhook

webhook_url
string<uri>

Webhook URL for background processing notifications

metadata
object

Arbitrary metadata to attach to the request

Response

Successful response

id
string
required

Unique identifier for the response

object
enum<string>
required

Object type, always 'response'

Available options:
response
created
integer
required

Unix timestamp of when the response was created

model
string
required

The model used for generating the response

content
string
required

The generated response content

conversation_id
string

ID of the conversation if part of a conversation

tools_used
object[]

List of tools that were used in generating the response

usage
object
metadata
object

Metadata attached to the request