Skip to content

Commit 76faf7a

Browse files
committed
feat: add snippets for mesh-to-mesh
1 parent 57b6191 commit 76faf7a

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"title": "Generate a mesh",
3+
"docs": "https://docs.aimlapi.com/api-references/image-models/",
4+
"payload": {
5+
"baseUrl": "https://api.aimlapi.com/v1",
6+
"apiKey": "<YOUR_API_KEY>"
7+
}
8+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const main = async () => {
5+
const response = await fetch('{{baseUrl}}/images/generations', {
6+
method: 'POST',
7+
headers: {
8+
Authorization: 'Bearer {{apiKey}}',
9+
'Content-Type': 'application/json',
10+
},
11+
body: JSON.stringify({
12+
model: '{{model}}',
13+
mesh_url: 'https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb',
14+
}),
15+
}).then((res) => res.json());
16+
17+
console.log('Generation:', response);
18+
};
19+
20+
main();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import requests
2+
3+
4+
def main():
5+
response = requests.post(
6+
"{{baseUrl}}/images/generations",
7+
headers={
8+
"Authorization": "Bearer {{apiKey}}",
9+
"Content-Type": "application/json",
10+
},
11+
json={
12+
"model": "{{model}}",
13+
"mesh_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb",
14+
},
15+
)
16+
17+
response.raise_for_status()
18+
data = response.json()
19+
20+
print("Generation:", data)
21+
22+
23+
if __name__ == "__main__":
24+
main()

0 commit comments

Comments
 (0)