Skip to content

Commit e5ab881

Browse files
feat: add new manual jsons for universal fetches (video, music)
1 parent 2bfb1c8 commit e5ab881

2 files changed

Lines changed: 268 additions & 0 deletions

File tree

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"components": {
8+
"securitySchemes": {
9+
"access-token": {
10+
"scheme": "bearer",
11+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
12+
"type": "http",
13+
"description": "Bearer key",
14+
"in": "header"
15+
}
16+
}
17+
},
18+
"security": [
19+
{
20+
"access-token": []
21+
}
22+
],
23+
"servers": [
24+
{
25+
"url": "https://api.aimlapi.com"
26+
}
27+
],
28+
"paths": {
29+
"/v2/generate/audio": {
30+
"get": {
31+
"x-hideTryItPanel": true,
32+
"x-codeSamples": [
33+
{
34+
"lang": "JavaScript",
35+
"source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v2/generate/audio?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>', {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n },\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
36+
},
37+
{
38+
"lang": "Python",
39+
"source": "import requests\n\nresponse = requests.get(\n \"https://api.aimlapi.com/v2/generate/audio?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n }\n)\n\ndata = response.json()\nprint(data)"
40+
},
41+
{
42+
"lang": "cURL",
43+
"source": "curl -L \\\n --request GET \\\n --url 'https://api.aimlapi.com/v2/generate/audio?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>'"
44+
},
45+
{
46+
"lang": "HTTP",
47+
"source": "GET /v2/generate/audio?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID> HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nAccept: */*"
48+
}
49+
],
50+
"operationId": "_v2_generate_audio",
51+
"parameters": [
52+
{
53+
"name": "generation_id",
54+
"required": true,
55+
"in": "query",
56+
"example": "<REPLACE_WITH_YOUR_GENERATION_ID>",
57+
"schema": { "type": "string" }
58+
}
59+
],
60+
"responses": {
61+
"200": {
62+
"content": {
63+
"application/json": {
64+
"schema": {
65+
"type": "object",
66+
"properties": {
67+
"id": {
68+
"type": "string",
69+
"description": "The ID of the generated audio.",
70+
"example": "60ac7c34-3224-4b14-8e7d-0aa0db708325"
71+
},
72+
"status": {
73+
"type": "string",
74+
"enum": ["queued", "generating", "completed", "error"],
75+
"description": "The current status of the generation task.",
76+
"example": "completed"
77+
},
78+
"audio_file": {
79+
"type": "object",
80+
"nullable": true,
81+
"properties": {
82+
"url": {
83+
"type": "string",
84+
"format": "uri",
85+
"description": "The URL where the file can be downloaded from.",
86+
"example": "https://cdn.aimlapi.com/eagle/files/lion/5N4F_QWb5K8rDSHfpUN0S_output.wav"
87+
}
88+
},
89+
"required": ["url"]
90+
},
91+
"error": {
92+
"type": "object",
93+
"nullable": true,
94+
"properties": {
95+
"name": {
96+
"type": "string"
97+
},
98+
"message": {
99+
"type": "string"
100+
}
101+
},
102+
"required": ["name", "message"],
103+
"description": "Description of the error, if any."
104+
},
105+
"meta": {
106+
"type": "object",
107+
"nullable": true,
108+
"properties": {
109+
"usage": {
110+
"type": "object",
111+
"nullable": true,
112+
"properties": {
113+
"credits_used": {
114+
"type": "number",
115+
"description": "The number of tokens consumed during generation.",
116+
"example": 120000
117+
}
118+
},
119+
"required": ["credits_used"]
120+
}
121+
},
122+
"description": "Additional details about the generation."
123+
}
124+
},
125+
"required": ["id", "status"]
126+
}
127+
}
128+
}
129+
}
130+
}
131+
}
132+
}
133+
}
134+
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"components": {
8+
"securitySchemes": {
9+
"access-token": {
10+
"scheme": "bearer",
11+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
12+
"type": "http",
13+
"description": "Bearer key",
14+
"in": "header"
15+
}
16+
}
17+
},
18+
"security": [
19+
{
20+
"access-token": []
21+
}
22+
],
23+
"servers": [
24+
{
25+
"url": "https://api.aimlapi.com"
26+
}
27+
],
28+
"paths": {
29+
"/v2/video/generations": {
30+
"get": {
31+
"x-hideTryItPanel": true,
32+
"x-codeSamples": [
33+
{
34+
"lang": "JavaScript",
35+
"source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>', {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n },\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
36+
},
37+
{
38+
"lang": "Python",
39+
"source": "import requests\n\nresponse = requests.get(\n \"https://api.aimlapi.com/v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n }\n)\n\ndata = response.json()\nprint(data)"
40+
},
41+
{
42+
"lang": "cURL",
43+
"source": "curl -L \\\n --request GET \\\n --url 'https://api.aimlapi.com/v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>'"
44+
},
45+
{
46+
"lang": "HTTP",
47+
"source": "GET /v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID> HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nAccept: */*"
48+
}
49+
],
50+
"operationId": "_v2_video_generations",
51+
"parameters": [
52+
{
53+
"name": "generation_id",
54+
"required": true,
55+
"in": "query",
56+
"example": "<REPLACE_WITH_YOUR_GENERATION_ID>",
57+
"schema": { "type": "string" }
58+
}
59+
],
60+
"responses": {
61+
"200": {
62+
"content": {
63+
"application/json": {
64+
"schema": {
65+
"type": "object",
66+
"properties": {
67+
"id": {
68+
"type": "string",
69+
"description": "The ID of the generated video.",
70+
"example": "60ac7c34-3224-4b14-8e7d-0aa0db708325"
71+
},
72+
"status": {
73+
"type": "string",
74+
"enum": ["queued", "generating", "completed", "error"],
75+
"description": "The current status of the generation task.",
76+
"example": "completed"
77+
},
78+
"video": {
79+
"type": "object",
80+
"nullable": true,
81+
"properties": {
82+
"url": {
83+
"type": "string",
84+
"format": "uri",
85+
"description": "The URL where the file can be downloaded from.",
86+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
87+
}
88+
},
89+
"required": ["url"]
90+
},
91+
"error": {
92+
"type": "object",
93+
"nullable": true,
94+
"properties": {
95+
"name": {
96+
"type": "string"
97+
},
98+
"message": {
99+
"type": "string"
100+
}
101+
},
102+
"required": ["name", "message"],
103+
"description": "Description of the error, if any."
104+
},
105+
"meta": {
106+
"type": "object",
107+
"nullable": true,
108+
"properties": {
109+
"usage": {
110+
"type": "object",
111+
"nullable": true,
112+
"properties": {
113+
"credits_used": {
114+
"type": "number",
115+
"description": "The number of tokens consumed during generation.",
116+
"example": 120000
117+
}
118+
},
119+
"required": ["credits_used"]
120+
}
121+
},
122+
"description": "Additional details about the generation."
123+
}
124+
},
125+
"required": ["id", "status"]
126+
}
127+
}
128+
}
129+
}
130+
}
131+
}
132+
}
133+
}
134+
}

0 commit comments

Comments
 (0)