List generations, or read several by id
curl --request GET \
--url https://myunite.ai/api/v1/create/generations \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://myunite.ai/api/v1/create/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://myunite.ai/api/v1/create/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"generations": [
{
"id": "<string>",
"status": "queued",
"mediaType": "image",
"model": {
"id": "<string>",
"name": "<string>"
},
"createdAt": "<string>",
"completedAt": "<string>",
"cost": {
"estimatedCredits": 123,
"chargedCredits": 123,
"refunded": true,
"refundedCredits": 123
},
"outputs": [
{
"url": "<string>",
"thumbnailUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123,
"durationSeconds": 123,
"format": "<string>",
"ref": "<string>"
}
],
"error": {
"code": "content_rejected",
"message": "<string>"
},
"prompt": "<string>",
"videoEditId": "<string>"
}
],
"nextCursor": "<string>",
"pollAfterSeconds": 0
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}Create
List generations, or read several by id
Lists the workspace’s generations, newest first, made in the app or through the API, paged with limit and nextCursor. With ids (up to 12, comma-separated) it returns those in that order and waitSeconds (up to 40) waits until all end; an id the workspace lacks comes back as not_found in its place. ids cannot be combined with mediaType, status, limit or cursor. The workspace must have generation enabled (public_create): otherwise 403 feature_not_enabled.
Requires the create:read scope.
GET
/
create
/
generations
List generations, or read several by id
curl --request GET \
--url https://myunite.ai/api/v1/create/generations \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://myunite.ai/api/v1/create/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://myunite.ai/api/v1/create/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"generations": [
{
"id": "<string>",
"status": "queued",
"mediaType": "image",
"model": {
"id": "<string>",
"name": "<string>"
},
"createdAt": "<string>",
"completedAt": "<string>",
"cost": {
"estimatedCredits": 123,
"chargedCredits": 123,
"refunded": true,
"refundedCredits": 123
},
"outputs": [
{
"url": "<string>",
"thumbnailUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123,
"durationSeconds": 123,
"format": "<string>",
"ref": "<string>"
}
],
"error": {
"code": "content_rejected",
"message": "<string>"
},
"prompt": "<string>",
"videoEditId": "<string>"
}
],
"nextCursor": "<string>",
"pollAfterSeconds": 0
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}Autorizações
Parâmetros de consulta
Esta página foi útil?