Responses API
Create, retrieve, and delete responses using the OpenAI Responses API format.
Create a response
POST
/v1/responses
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | The model to use (e.g. "hacxgpt"). |
input | string/array | Required | The user input. Can be a simple string or an array of input items. |
instructions | string | Optional | System-level instructions for the model. |
temperature | number | Optional | Sampling temperature between 0 and 2. Default: 1. |
max_tokens | integer | Optional | Maximum number of tokens to generate. |
tools | array | Optional | A list of tools the model can use. |
Request
curl https://api.hacxgpt.com/v1/responses \
-H "Authorization: Bearer hk-proj-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "hacxgpt",
"input": "What is the capital of France?",
"instructions": "You are a helpful assistant.",
"temperature": 0.7
}'Response
Response
{
"id": "resp_a1b2c3d4e5f6",
"object": "response",
"created_at": 1710000000,
"status": "completed",
"model": "hacxgpt",
"output": [
{
"type": "message",
"id": "msg_abc123",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Hello! How can I help you today?",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 10,
"output_tokens": 8,
"total_tokens": 18
}
}Get a response
GET
/v1/responses/{response_id}
Retrieve a previously created response by its ID.
cURL
curl https://api.hacxgpt.com/v1/responses/resp_a1b2c3d4e5f6 \
-H "Authorization: Bearer hk-proj-YOUR_API_KEY"Delete a response
DELETE
/v1/responses/{response_id}
Delete a stored response by its ID.
cURL
curl -X DELETE https://api.hacxgpt.com/v1/responses/resp_a1b2c3d4e5f6 \
-H "Authorization: Bearer hk-proj-YOUR_API_KEY"Note
Responses are stored temporarily and can be retrieved or deleted using the response ID. Authentication is required for all operations.