Generation Outputs
GET
/v1/image/generation/outputs
This endpoint is for retrieving your generation outputs. Although it supports many query parameters, in its simplest form, you just need to do a GET request to the endpoint.
Request Example
curl -X GET 'https://api.stablecog.com/v1/image/generation/outputs' \
-H 'Authorization: Bearer <YOUR_STABLECOG_API_KEY>' \
const API_KEY = process.env.STABLECOG_API_KEY;
const API_HOST = 'https://api.stablecog.com';
const API_ENDPOINT = '/v1/image/generation/outputs';
const API_URL = `${API_HOST}${ENDPOINT}`;
const res = await fetch(API_URL, {
headers: {
Authorization: `Bearer ${API_KEY}`
}
});
const resJSON = await res.json();
console.log(resJSON);
import os
import requests
import json
API_KEY = os.environ.get("STABLECOG_API_KEY")
API_HOST = "https://api.stablecog.com"
API_ENDPOINT = "/v1/image/generation/outputs"
API_URL = f"{API_HOST}{API_ENDPOINT}"
headers = {
"Authorization": f"Bearer {API_KEY}"
}
res = requests.get(API_URL, headers=headers)
res_json = res.json()
print(json.dumps(res_json, indent=2))
Response
{
"total_count": 215,
"outputs": [···],
"next": "2023-05-26T14:14:49.457057Z"
}
Request Headers
Authorization required
string
Send your API key as the value of this header in the following form:
Authorization: Bearer <YOUR_STABLECOG_API_KEY>
.Query Parameters
cursor
string
This is used for pagination. You can get the next page by sending the cursor called
next
in the previous page result.Response Body
total_count
int
The total number of outputs you have.
next
string
The cursor for getting the next page of outputs. If there is no next page, this property won't exist.
outputs
array of TOutputFull
Generated images.