Serverless Inference
Validated on 9 Oct 2024 • Last edited on 26 Mar 2026
DigitalOcean Gradient™ AI Agentic Cloud allows access to serverless inference models. You can access models by providing an inference key.
Note: The Serverless Inference API uses a separate base URL (https://inference.do-ai.run)
and is independent of the main DigitalOcean control-plane API (https://api.digitalocean.com).
https://inference.do-ai.run
Endpoints
POST Generate Image, Audio, or Text-to-Speech Using fal Models
/v1/async-invoke
Authorizations:
bearer_auth
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll for the result.
Request Body: application/json
input
required
The input parameters for the model invocation. Fields vary by model type.
For image generation models (e.g., fal-ai/flux/schnell, fal-ai/fast-sdxl), use prompt along with optional image parameters like output_format, num_inference_steps, guidance_scale, num_images, and enable_safety_checker.
For audio generation models (e.g., fal-ai/stable-audio-25/text-to-audio), use prompt along with seconds_total to control the duration.
For text-to-speech models (e.g., fal-ai/elevenlabs/tts/multilingual-v2), use text with the content you want converted to speech.
Show child properties
enable_safety_checker
optional Nullable
trueWhether to enable the safety checker for generated content.
guidance_scale
optional Nullable
3.5Controls how closely the image generation model follows the prompt. Higher values produce output more closely matching the prompt.
num_images
optional Nullable
1The number of images to generate.
num_inference_steps
optional Nullable
4The number of inference steps to use during image generation. More steps generally produce higher quality output but take longer.
output_format
optional Nullable
landscape_4_3The desired output format or aspect ratio for image generation.
prompt
optional
A futuristic city at sunsetThe text prompt describing the desired output. Used for image generation and audio generation models.
seconds_total
optional Nullable
60The total duration in seconds for generated audio. Used for audio generation models.
text
optional
This text-to-speech example uses DigitalOcean multilingual voice.The text content to convert to speech. Used for text-to-speech models.
(additional properties)
optional
Additional properties are allowed.
model_id
required
fal-ai/flux/schnellThe ID of the model to invoke asynchronously.
tags
optional Nullable
An optional list of key-value tags to attach to the invocation request for tracking or categorization.
Show child properties
key
required
typeThe tag key.
value
required
testThe tag value.
Request: /v1/async-invoke
{
"input": {
"prompt": "Techno song with futuristic sounds",
"seconds_total": 60
},
"model_id": "fal-ai/stable-audio-25/text-to-audio",
"tags": [
{
"key": "type",
"value": "test"
}
]
}curl -X POST \
-H "Authorization: Bearer $MODEL_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_id": "fal-ai/flux/schnell",
"input": {
"prompt": "A futuristic city at sunset"
}
}' \
"https://inference.do-ai.run/v1/async-invoke"Responses
202
The async invocation request was accepted.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
completed_at
optional Nullable
The timestamp when the job completed. Null until finished.
created_at
required
2026-01-22T19:19:19.112403432ZThe timestamp when the request was created.
error
optional Nullable
Error message if the job failed. Null on success.
model_id
required
fal-ai/fast-sdxlThe model ID that was invoked.
output
optional Nullable
The output of the invocation. Null while the job is queued or in progress. Contains the result once completed.
Show child properties
(additional properties)
optional
Additional properties are allowed.
request_id
required
6590784a-ce47-4556-9ff4-53baff2693fbA unique identifier for the async invocation request. Use this ID to check the status and retrieve the result.
started_at
optional Nullable
The timestamp when the job started processing. Null while queued.
status
required
QUEUEDThe current status of the async invocation.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2026-01-22T19:19:19.112403432Z",
"error": "string",
"model_id": "fal-ai/fast-sdxl",
"request_id": "6590784a-ce47-4556-9ff4-53baff2693fb",
"started_at": "2019-08-24T14:15:22Z",
"status": "QUEUED"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Create a model response for the given chat conversation
/v1/chat/completions
Authorizations:
bearer_auth
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Creates a model response for the given chat conversation.
Request Body: application/json
frequency_penalty
optional Nullable
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
logit_bias
optional Nullable
Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
Show child properties
(additional properties)
optional
Additional properties are allowed.
logprobs
optional Nullable
Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
max_completion_tokens
optional Nullable
The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run.
max_tokens
optional Nullable
The maximum number of tokens that can be generated in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length.
messages
required
A list of messages comprising the conversation so far.
Show child properties
content
optional Nullable
Hello, how are you?The contents of the message.
reasoning_content
optional Nullable
The reasoning content generated by the model (assistant messages only).
refusal
optional Nullable
The refusal message generated by the model (assistant messages only).
role
required
userThe role of the message author.
tool_call_id
optional
call_abc123Tool call that this message is responding to (tool messages only).
tool_calls
optional
The tool calls generated by the model (assistant messages only).
Show child properties
function
required
Show child properties
arguments
required
{"location": "Boston"}The arguments to call the function with, as generated by the model in JSON format.
name
required
get_weatherThe name of the function to call.
id
required
call_abc123The ID of the tool call.
type
required
functionThe type of the tool. Currently, only function is supported.
metadata
optional Nullable
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Show child properties
(additional properties)
optional
Additional properties are allowed.
model
required
llama3-8b-instructModel ID used to generate the response.
n
optional Nullable
1How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
presence_penalty
optional Nullable
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
reasoning_effort
optional Nullable
Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
seed
optional Nullable
If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed.
stop
optional
Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
stream
optional Nullable
If set to true, the model response data will be streamed to the client as it is generated using server-sent events.
stream_options
optional Nullable
Options for streaming response. Only set this when you set stream to true.
Show child properties
include_usage
optional
If set, an additional chunk will be streamed before the data [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array.
temperature
optional Nullable
1What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.
tool_choice
optional
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. none is the default when no tools are present. auto is the default if tools are present.
Option 1
function
function
required
Show child properties
name
required
get_weatherThe name of the function to call.
type
required
functiontools
optional
A list of tools the model may call. Currently, only functions are supported as a tool.
Show child properties
function
required
Show child properties
description
optional
Get the current weather for a location.A description of what the function does, used by the model to choose when and how to call the function.
name
required
get_weatherThe name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
parameters
optional
The parameters the function accepts, described as a JSON Schema object.
Show child properties
(additional properties)
optional
Additional properties are allowed.
type
required
functionThe type of the tool. Currently, only function is supported.
top_logprobs
optional Nullable
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
top_p
optional Nullable
1An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.
user
optional
user-1234A unique identifier representing your end-user, which can help DigitalOcean to monitor and detect abuse.
Request: /v1/chat/completions
{
"frequency_penalty": 0,
"logprobs": false,
"max_completion_tokens": 0,
"max_tokens": 0,
"messages": [
{
"content": "Hello, how are you?",
"reasoning_content": "string",
"refusal": "string",
"role": "user",
"tool_call_id": "call_abc123",
"tool_calls": []
}
],
"model": "llama3-8b-instruct",
"n": 1,
"presence_penalty": 0,
"reasoning_effort": "none",
"seed": 0,
"stop": "string",
"stream": false,
"stream_options": {
"include_usage": true
},
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"type": "function"
}
],
"top_logprobs": 0,
"top_p": 1,
"user": "user-1234"
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODEL_ACCESS_KEY" \
-d '{"messages": [{"role": "user", "content": "What is the capital of Portugal?"}], "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"}' \
"https://inference.do-ai.run/v1/chat/completions"Responses
200
Successful chat completion. When stream is true, response is sent as Server-Sent Events (text/event-stream); otherwise a single JSON object (application/json) is returned.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
choices
required
A list of chat completion choices. Can be more than one if n is greater than 1.
Show child properties
finish_reason
required
stopThe reason the model stopped generating tokens. stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, tool_calls if the model called a tool.
index
required
0The index of the choice in the list of choices.
logprobs
required Nullable
Log probability information for the choice.
Show child properties
content
required Nullable
A list of message content tokens with log probability information.
Show child properties
bytes
required Nullable
A list of integers representing the UTF-8 bytes representation of the token. Can be null if there is no bytes representation for the token.
logprob
required
-1.2345The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely.
token
required
HelloThe token.
top_logprobs
required
List of the most likely tokens and their log probability, at this token position.
refusal
required Nullable
A list of message refusal tokens with log probability information.
Show child properties
bytes
required Nullable
A list of integers representing the UTF-8 bytes representation of the token. Can be null if there is no bytes representation for the token.
logprob
required
-1.2345The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely.
token
required
HelloThe token.
top_logprobs
required
List of the most likely tokens and their log probability, at this token position.
message
required
A chat completion message generated by the model.
Show child properties
content
required Nullable
Hello! How can I help you today?The contents of the message.
reasoning_content
required Nullable
The reasoning content generated by the model.
refusal
required Nullable
The refusal message generated by the model.
role
required
assistantThe role of the author of this message.
tool_calls
optional
The tool calls generated by the model, such as function calls.
Show child properties
function
required
id
required
call_abc123The ID of the tool call.
type
required
functionThe type of the tool.
created
required
1677649420The Unix timestamp (in seconds) of when the chat completion was created.
id
required
chatcmpl-abc123A unique identifier for the chat completion.
model
required
llama3-8b-instructThe model used for the chat completion.
object
required
chat.completionThe object type, which is always chat.completion.
usage
optional
Usage statistics for the completion request.
Show child properties
cache_created_input_tokens
required
0Number of prompt tokens written to cache.
cache_creation
required
Breakdown of prompt tokens written to cache.
Show child properties
ephemeral_1h_input_tokens
required
0Number of prompt tokens written to 1h cache.
ephemeral_5m_input_tokens
required
0Number of prompt tokens written to 5m cache.
cache_read_input_tokens
required
0Number of prompt tokens read from cache.
completion_tokens
required
20Number of tokens in the generated completion.
prompt_tokens
required
10Number of tokens in the prompt.
total_tokens
required
30Total number of tokens used in the request (prompt + completion).
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"choices": [
{
"finish_reason": "stop",
"index": 0
}
],
"created": 1677649420,
"id": "chatcmpl-abc123",
"model": "llama3-8b-instruct",
"object": "chat.completion",
"usage": {
"cache_created_input_tokens": 0,
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"cache_read_input_tokens": 0,
"completion_tokens": 20,
"prompt_tokens": 10,
"total_tokens": 30
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Generate images from text prompts
/v1/images/generations
Authorizations:
bearer_auth
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation model with automatic prompt optimization and enhanced visual capabilities.
Request Body: application/json
background
optional Nullable
autoThe background setting for the image generation. Supported values: transparent, opaque, auto.
model
required
openai-gpt-image-1The model to use for image generation.
moderation
optional Nullable
autoThe moderation setting for the image generation. Supported values: low, auto.
n
required
1The number of images to generate. Must be between 1 and 10.
output_compression
optional Nullable
100The output compression level for the image generation (0-100).
output_format
optional Nullable
pngThe output format for the image generation. Supported values: png, webp, jpeg.
partial_images
optional Nullable
1The number of partial image chunks to return during streaming generation. Defaults to 0. When stream=true, this must be greater than 0 to receive progressive updates of the image as it is being generated.
prompt
required
A cute baby sea otter floating on its back in calm blue waterA text description of the desired image(s). Supports up to 32,000 characters and provides automatic prompt optimization for best results.
quality
optional Nullable
autoThe quality of the image that will be generated. Supported values: auto, high, medium, low.
size
optional
autoThe size of the generated images. GPT-IMAGE-1 supports: auto (automatically select best size), 1536x1024 (landscape), 1024x1536 (portrait).
stream
optional Nullable
falseIf set to true, partial image data will be streamed as the image is being generated. The response will be sent as server-sent events with partial image chunks. When stream is true, partial_images must be greater than 0.
user
optional Nullable
user-1234A unique identifier representing your end-user, which can help DigitalOcean to monitor and detect abuse.
Request: /v1/images/generations
{
"background": "auto",
"model": "openai-gpt-image-1",
"moderation": "auto",
"n": 1,
"output_compression": 100,
"output_format": "png",
"partial_images": 1,
"prompt": "A cute baby sea otter floating on its back in calm blue water",
"quality": "auto",
"size": "auto",
"stream": false,
"user": "user-1234"
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODEL_ACCESS_KEY" \
-d '{"prompt": "A cute baby sea otter floating on its back in calm blue water", "model": "openai-gpt-image-1", "size": "auto", "quality": "auto"}' \
"https://inference.do-ai.run/v1/images/generations"Responses
200
Successful image generation. When stream is true, response is sent as Server-Sent Events (text/event-stream); otherwise a single JSON object (application/json) is returned.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
background
optional Nullable
opaqueThe background setting used for the image generation.
created
required
1677649456The Unix timestamp (in seconds) of when the images were created.
data
required
The list of generated images.
Show child properties
b64_json
required
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEX...The base64-encoded JSON of the generated image.
revised_prompt
optional
The optimized prompt that was used to generate the image.
output_format
optional Nullable
pngThe output format of the generated image.
quality
optional Nullable
highThe quality setting used for the image generation.
size
optional Nullable
1024x1024The size of the generated image.
usage
optional Nullable
Usage statistics for the image generation request.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"background": "opaque",
"created": 1677649456,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEX...",
"revised_prompt": "A cute baby sea otter floating on its back in calm blue water, captured with professional photography lighting and composition"
}
],
"output_format": "png",
"quality": "high",
"size": "1024x1024",
"usage": {
"input_tokens": 12,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 12
},
"output_tokens": 4160,
"total_tokens": 4172
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List available models
/v1/models
Authorizations:
bearer_auth
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Request: /v1/models
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODEL_ACCESS_KEY" \
"https://inference.do-ai.run/v1/models"Responses
200
A list of all available models.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
required
The list of available models.
Show child properties
created
required
1686935002The Unix timestamp (in seconds) when the model was created.
id
required
meta-llama/Meta-Llama-3.1-8B-InstructThe model identifier, which can be referenced in the API endpoints.
object
required
modelThe object type, which is always "model".
owned_by
required
digitaloceanThe organization that owns the model.
object
required
listThe object type, which is always "list".
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": [
{
"created": 1686935002,
"id": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "model",
"owned_by": "digitalocean"
}
],
"object": "list"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Send Prompt to a Model Using the Responses API
/v1/responses
Authorizations:
bearer_auth
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Generate text responses from text prompts. This endpoint supports both streaming and non-streaming responses for supported text models.
Request Body: application/json
input
required
The prompt or input content you want the model to respond to. Can be a simple text string or an array of message objects for conversation context.
instructions
optional Nullable
You are a helpful assistant.System-level instructions for the model. This sets the behavior and context for the response generation.
max_output_tokens
optional Nullable
50The maximum number of tokens to generate in the response.
metadata
optional Nullable
{"session_id":"abc123"}Set of key-value pairs that can be attached to the request.
Show child properties
(additional properties)
optional
Additional properties are allowed.
model
required
openai-gpt-oss-20bThe model ID of the model you want to use. Get the model ID using /v1/models or on the available models page.
stop
optional Nullable
Up to 4 sequences where the API will stop generating further tokens.
stream
optional Nullable
falseSet to true to stream partial responses as Server-Sent Events.
stream_options
optional Nullable
Options for streaming response. Only set this when you set stream to true.
Show child properties
include_usage
optional
trueIf set, an additional chunk will be streamed before the data: [DONE] message with token usage statistics for the entire request.
temperature
optional Nullable
0.7A value between 0.0 and 2.0 to control randomness and creativity. Lower values like 0.2 make the output more focused and deterministic, while higher values like 0.8 make it more random.
tool_choice
optional
Controls which (if any) tool is called by the model.
Option 1
function
function
required
Show child properties
name
required
get_weatherThe name of the function to call.
type
required
functiontools
optional Nullable
A list of tools the model may call.
Show child properties
description
optional
Get the current weather in a given location.A description of what the function does.
name
optional
get_weatherThe name of the function to be called.
parameters
optional
The parameters the function accepts, described as a JSON Schema object.
Show child properties
(additional properties)
optional
Additional properties are allowed.
type
required
functionThe type of the tool.
top_p
optional Nullable
1An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
user
optional Nullable
user-1234A unique identifier representing your end-user.
Request: /v1/responses
{
"input": "What is the capital of France?",
"instructions": "You are a helpful assistant.",
"max_output_tokens": 50,
"metadata": {
"session_id": "abc123"
},
"model": "openai-gpt-oss-20b",
"stop": "\n",
"stream": false,
"stream_options": {
"include_usage": true
},
"temperature": 0.7,
"tool_choice": "auto",
"tools": [
{
"description": "Get the current weather in a given location.",
"name": "get_weather",
"type": "function"
}
],
"top_p": 1,
"user": "user-1234"
}curl -sS -X POST \
-H "Authorization: Bearer $MODEL_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai-gpt-oss-20b",
"input": "What is the capital of France?",
"max_output_tokens": 50,
"temperature": 0.7,
"stream": false
}' \
"https://inference.do-ai.run/v1/responses"Responses
200
Successful response. When stream is true, response is sent as Server-Sent Events (text/event-stream); otherwise a single JSON object (application/json) is returned.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
created
required
1721596428The Unix timestamp (in seconds) of when the response was created.
id
required
response-abc123def456A unique identifier for the response.
max_output_tokens
optional Nullable
50Maximum output tokens setting.
model
required
openai-gpt-oss-20bThe model used to generate the response.
object
required
responseThe object type, which is always response.
output
required
An array of content items generated by the model. Each item has a type and a content array. Types include reasoning and output text.
Show child properties
arguments
optional Nullable
{"location": "San Francisco"}JSON string of function arguments (present when type is function_call).
call_id
optional Nullable
call_abc123The unique ID of the function tool call (present when type is function_call).
content
required
Array of content parts for this output item. Each part has a type and text. Content types include reasoning_text for reasoning items and output_text for final output.
Show child properties
text
required
The capital of France is **Paris**.The text content.
type
required
output_textThe type of content part. reasoning_text for reasoning content, output_text for final output text.
id
optional
item_abc123The unique ID of the output item.
name
optional Nullable
get_weatherThe name of the function to call (present when type is function_call).
role
optional Nullable
assistantThe role associated with this output item (typically assistant).
status
optional Nullable
completedStatus of the item.
type
required
messageThe type of output item. One of reasoning, message, or function_call.
parallel_tool_calls
optional Nullable
falseWhether parallel tool calls are enabled.
status
optional Nullable
completedStatus of the response.
temperature
optional Nullable
0.7Temperature setting used for the response.
tool_choice
optional Nullable
autoTool choice setting used for the response.
tools
optional Nullable
Tools available for the response.
Show child properties
description
optional
Get the current weather in a given location.A description of what the function does.
name
optional
get_weatherThe name of the function.
parameters
optional
The parameters the function accepts.
Show child properties
(additional properties)
optional
Additional properties are allowed.
type
required
functionThe type of the tool.
top_p
optional Nullable
1Top-p setting used for the response.
usage
required
Detailed usage statistics for the Responses API request, including input/output token counts and detailed breakdowns.
Show child properties
input_tokens
required
133The number of input tokens.
input_tokens_details
required
A detailed breakdown of the input tokens.
Show child properties
cached_tokens
required
128The number of tokens that were retrieved from the cache.
output_tokens
required
41The number of output tokens.
output_tokens_details
required
A detailed breakdown of the output tokens.
Show child properties
reasoning_tokens
required
24The number of reasoning tokens.
tool_output_tokens
required
0The number of tool output tokens.
total_tokens
required
174The total number of tokens used.
user
optional Nullable
user-1234User identifier.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"created": 1721596428,
"id": "response-abc123def456",
"max_output_tokens": 50,
"model": "openai-gpt-oss-20b",
"object": "response",
"output": [
{
"arguments": "{\"location\": \"San Francisco\"}",
"call_id": "call_abc123",
"content": [],
"id": "item_abc123",
"name": "get_weather",
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"parallel_tool_calls": false,
"status": "completed",
"temperature": 0.7,
"tool_choice": "auto",
"tools": [
{
"description": "Get the current weather in a given location.",
"name": "get_weather",
"type": "function"
}
],
"top_p": 1,
"usage": {
"input_tokens": 133,
"input_tokens_details": {
"cached_tokens": 128
},
"output_tokens": 41,
"output_tokens_details": {
"reasoning_tokens": 24,
"tool_output_tokens": 0
},
"total_tokens": 174
},
"user": "user-1234"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}