|
8438 | 8438 | "x-codeSamples": [ |
8439 | 8439 | { |
8440 | 8440 | "lang": "JavaScript", |
8441 | | - "source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: 'openai/gpt-5-1-chat-latest',\n messages:[\n {\n role:'user',\n content: 'Hello'\n }\n ],\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();" |
| 8441 | + "source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/responses', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_API_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();" |
8442 | 8442 | }, |
8443 | 8443 | { |
8444 | 8444 | "lang": "Python", |
8445 | | - "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/chat/completions\",\n headers={\n \"Content-Type\":\"application/json\", \n \"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n \"model\":\"openai/gpt-5-1-chat-latest\",\n \"messages\":[\n {\n \"role\":\"user\",\n \"content\":\"Hello\"\n }\n ],\n }\n)\n\ndata = response.json()\nprint(data)" |
| 8445 | + "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/responses\",\n headers={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer <YOUR_API_KEY>\",\n },\n json={\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n }\n)\n\ndata = response.json()\nprint(data)" |
8446 | 8446 | }, |
8447 | 8447 | { |
8448 | 8448 | "lang": "cURL", |
8449 | | - "source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/chat/completions' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n ]\n }'" |
| 8449 | + "source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/responses' \\\n --header 'Authorization: Bearer <YOUR_API_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n }'" |
8450 | 8450 | }, |
8451 | 8451 | { |
8452 | 8452 | "lang": "HTTP", |
8453 | | - "source": "POST /v1/chat/completions HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\nContent-Length: 59\n\n{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n ]\n}" |
| 8453 | + "source": "POST / HTTP/1.1\nHost: test.com\nAuthorization: Bearer <YOUR_API_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n}" |
8454 | 8454 | } |
8455 | 8455 | ] |
8456 | 8456 | } |
@@ -16883,19 +16883,19 @@ |
16883 | 16883 | "x-codeSamples": [ |
16884 | 16884 | { |
16885 | 16885 | "lang": "JavaScript", |
16886 | | - "source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: 'openai/gpt-5-1-chat-latest',\n messages:[\n {\n role:'user',\n content: 'Hello'\n }\n ],\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();" |
| 16886 | + "source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/responses', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_API_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();" |
16887 | 16887 | }, |
16888 | 16888 | { |
16889 | 16889 | "lang": "Python", |
16890 | | - "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/chat/completions\",\n headers={\n \"Content-Type\":\"application/json\", \n \"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n \"model\":\"openai/gpt-5-1-chat-latest\",\n \"messages\":[\n {\n \"role\":\"user\",\n \"content\":\"Hello\"\n }\n ],\n }\n)\n\ndata = response.json()\nprint(data)" |
| 16890 | + "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/responses\",\n headers={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer <YOUR_API_KEY>\",\n },\n json={\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n }\n)\n\ndata = response.json()\nprint(data)" |
16891 | 16891 | }, |
16892 | 16892 | { |
16893 | 16893 | "lang": "cURL", |
16894 | | - "source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/chat/completions' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n ]\n }'" |
| 16894 | + "source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/responses' \\\n --header 'Authorization: Bearer <YOUR_API_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n }'" |
16895 | 16895 | }, |
16896 | 16896 | { |
16897 | 16897 | "lang": "HTTP", |
16898 | | - "source": "POST /v1/chat/completions HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\nContent-Length: 59\n\n{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"hi\"\n }\n ]\n}" |
| 16898 | + "source": "POST / HTTP/1.1\nHost: test.com\nAuthorization: Bearer <YOUR_API_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n \"model\": \"openai/gpt-5-1-chat-latest\",\n \"input\": \"Hello\"\n}" |
16899 | 16899 | } |
16900 | 16900 | ] |
16901 | 16901 | } |
|
0 commit comments