File tree Expand file tree Collapse file tree
shared/snippets/image/mesh-to-mesh Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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();
Original file line number Diff line number Diff line change 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()
You can’t perform that action at this time.
0 commit comments