Title: Error code: 500 | 400 Unable to access model gpt-4o-mini. · Issue #3 · aimlapi/api-docs · GitHub
Open Graph Title: Error code: 500 | 400 Unable to access model gpt-4o-mini. · Issue #3 · aimlapi/api-docs
X Title: Error code: 500 | 400 Unable to access model gpt-4o-mini. · Issue #3 · aimlapi/api-docs
Description: I got the simplest code possible with api, I just got a fresh and new API key, but I get this error: "error : Error code: 500 - {'requestId': 'ebc099bf-7562-452d-854c-c44e6d0c7b5a', 'statusCode': 500, 'timestamp': '2024-10-01T15:31:02.16...
Open Graph Description: I got the simplest code possible with api, I just got a fresh and new API key, but I get this error: "error : Error code: 500 - {'requestId': 'ebc099bf-7562-452d-854c-c44e6d0c7b5a', 'statusCode': 5...
X Description: I got the simplest code possible with api, I just got a fresh and new API key, but I get this error: "error : Error code: 500 - {'requestId': 'ebc099bf-7562-452d-854c-c44e6d0c7b5a&...
Opengraph URL: https://github.com/aimlapi/api-docs/issues/3
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error code: 500 | 400 Unable to access model gpt-4o-mini.","articleBody":"I got the simplest code possible with api, I just got a fresh and new API key, but I get this error:\r\n\r\n\"error : Error code: 500 - {'requestId': 'ebc099bf-7562-452d-854c-c44e6d0c7b5a', 'statusCode': 500, 'timestamp': '2024-10-01T15:31:02.168Z', 'path': '/chat/completions', 'message': '400 Unable to access model gpt-4o-mini. '}\"\r\n\r\nHere my code:\r\n`base_url = \"https://api.aimlapi.com\"\r\napi_key = \"94aa0232a914485591fba8ab561e7485\"\r\nsystem_prompt = \"You are a travel agent. Be descriptive and helpful.\"\r\n\r\napi = OpenAI(api_key=api_key, base_url=base_url)\r\n# Voici la cog nommée \"Tests\" avec sa classe correspondante\r\n\r\nclass Tests(commands.Cog, name=\"tests\"):\r\n def __init__(self, bot) -\u003e None:\r\n self.bot = bot\r\n \r\n\r\n @commands.hybrid_command()\r\n async def test_openai(self,ctx,question:str):\r\n user_prompt = question\r\n await ctx.defer()\r\n try:\r\n completion = api.chat.completions.create(\r\n model=\"mistralai/Mistral-7B-Instruct-v0.2\",\r\n messages=[\r\n {\"role\": \"system\", \"content\": system_prompt},\r\n {\"role\": \"user\", \"content\": user_prompt},\r\n ],\r\n temperature=0.7,\r\n max_tokens=256,\r\n )\r\n\r\n response = completion.choices[0].message.content\r\n\r\n print(\"User:\", user_prompt)\r\n print(\"AI:\", response)\r\n await ctx.send(f\"user : {user_prompt}\\nAI : {response}\")\r\n except Exception as e:\r\n await ctx.send(f\"error : {e}\")`\r\n \r\nIs there any way to fix it?\r\nRgds","author":{"url":"https://github.com/Unrectified","@type":"Person","name":"Unrectified"},"datePublished":"2024-10-01T15:34:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/api-docs/issues/3"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2255f4ee-9adc-1431-b185-67966992d825 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82EC:32255D:1479A54:1BC63EC:6A4D7430 |
| html-safe-nonce | dab25c4140f81fa88fa8cd66fac104e8f38805b6e0f3d45e9bacd6ed6cc5369a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkVDOjMyMjU1RDoxNDc5QTU0OjFCQzYzRUM6NkE0RDc0MzAiLCJ2aXNpdG9yX2lkIjoiODI3MzIwNzkzNDI1NjUxMDAwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c4753fb1c4cbc0b5dc637a2f98e956c3e2e0a4dd2d593fae58a7db89e73e0082 |
| hovercard-subject-tag | issue:2559601703 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/aimlapi/api-docs/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/70d1c9168a46639f3046c00287fb67c95e278ce0804e6029775e38c5a5ecdee5/aimlapi/api-docs/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/70d1c9168a46639f3046c00287fb67c95e278ce0804e6029775e38c5a5ecdee5/aimlapi/api-docs/issues/3 |
| og:image:alt | I got the simplest code possible with api, I just got a fresh and new API key, but I get this error: "error : Error code: 500 - {'requestId': 'ebc099bf-7562-452d-854c-c44e6d0c7b5a', 'statusCode': 5... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unrectified |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-preview |
| go-import | github.com/aimlapi/api-docs git https://github.com/aimlapi/api-docs.git |
| octolytics-dimension-user_id | 158580330 |
| octolytics-dimension-user_login | aimlapi |
| octolytics-dimension-repository_id | 806997654 |
| octolytics-dimension-repository_nwo | aimlapi/api-docs |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 806997654 |
| octolytics-dimension-repository_network_root_nwo | aimlapi/api-docs |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width