Skip to content

API Field missing #481

Description

@BlueDragon4251

When i choose custom and the endpoint is :

https://codestral.mistral.ai/v1/chat/completions

I can't set any api key so i can use codestral

Error:

APICallError [AI_APICallError]: Unauthorized at file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:445:14 at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async postToApi (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:336:28) at async OpenAIChatLanguageModel.doGenerate (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@ai-sdk/openai/dist/index.mjs:358:50) at async fn (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:3410:30) at async file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:258:22 at async _retryWithExponentialBackoff (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:86:12) at async fn (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:3370:32) at async file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:258:22 at async healthcheck (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@srcbook/api/dist/ai/generate.mjs:127:20) { cause: undefined, url: 'https://codestral.mistral.ai/v1/chat/completions/chat/completions', requestBodyValues: { model: 'codestral-latest', logit_bias: undefined, logprobs: undefined, top_logprobs: undefined, user: undefined, parallel_tool_calls: undefined, max_tokens: undefined, temperature: 0, top_p: undefined, frequency_penalty: undefined, presence_penalty: undefined, stop: undefined, seed: undefined, response_format: undefined, messages: [ [Object], [Object] ], tools: undefined, tool_choice: undefined }, statusCode: 401, responseHeaders: { 'access-control-allow-origin': '*', 'alt-svc': 'h3=":443"; ma=86400', 'cf-cache-status': 'DYNAMIC', 'cf-ray': '904d26387a24c2d4-VIE', connection: 'keep-alive', 'content-length': '81', 'content-type': 'application/json; charset=utf-8', date: 'Mon, 20 Jan 2025 06:53:45 GMT', server: 'cloudflare', 'set-cookie': '__cf_bm=9w2ADfQc8SlUhH8gD6k.uUFUbCtMwTh6r7AFbCgqhbQ-1737356025-1.0.1.1-oolvVRXrt6dRy3T9_mW3sSN8sT3CoZOfVDksuTEFarSD2YQjolBu2wd82Ajc3Ab_SU13KnYmH7Wn8C8HyXxM5w; path=/; expires=Mon, 20-Jan-25 07:23:45 GMT; domain=.mistral.ai; HttpOnly; Secure; SameSite=None', 'www-authenticate': 'Key', 'x-kong-request-id': '5bd99b13d6ec0302d99e4d769f6a4417', 'x-kong-response-latency': '0' }, responseBody: '{\n' + ' "message":"Unauthorized",\n' + ' "request_id":"5bd99b13d6ec0302d99e4d769f6a4417"\n' + '}', isRetryable: false, data: undefined, [Symbol(vercel.ai.error)]: true, [Symbol(vercel.ai.error.AI_APICallError)]: true } APICallError [AI_APICallError]: Unauthorized at file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:445:14 at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async postToApi (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:336:28) at async OpenAIChatLanguageModel.doGenerate (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@ai-sdk/openai/dist/index.mjs:358:50) at async fn (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:3410:30) at async file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:258:22 at async _retryWithExponentialBackoff (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:86:12) at async fn (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:3370:32) at async file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/ai/dist/index.mjs:258:22 at async healthcheck (file:///C:/Users/evoly/AppData/Local/npm-cache/_npx/f3cf20110f0917c8/node_modules/@srcbook/api/dist/ai/generate.mjs:127:20) { cause: undefined, url: 'https://codestral.mistral.ai/v1/chat/completions/chat/completions', requestBodyValues: { model: 'codestral-latest', logit_bias: undefined, logprobs: undefined, top_logprobs: undefined, user: undefined, parallel_tool_calls: undefined, max_tokens: undefined, temperature: 0, top_p: undefined, frequency_penalty: undefined, presence_penalty: undefined, stop: undefined, seed: undefined, response_format: undefined, messages: [ [Object], [Object] ], tools: undefined, tool_choice: undefined }, statusCode: 401, responseHeaders: { 'access-control-allow-origin': '*', 'alt-svc': 'h3=":443"; ma=86400', 'cf-cache-status': 'DYNAMIC', 'cf-ray': '904d26a82934c219-VIE', connection: 'keep-alive', 'content-length': '81', 'content-type': 'application/json; charset=utf-8', date: 'Mon, 20 Jan 2025 06:54:03 GMT', server: 'cloudflare', 'set-cookie': '__cf_bm=9NSw.1zG3Obe5gK6nm_UWI6h5srYBLlTdjXOISze8fw-1737356043-1.0.1.1-KiHK7Qjr7Ck7nOG5qk07ggIYgjmgkXkKdQWthzRAdlztD79sokZKxipBGSdnyxlvr7lYQ1oQvCBZolefY_Z9wQ; path=/; expires=Mon, 20-Jan-25 07:24:03 GMT; domain=.mistral.ai; HttpOnly; Secure; SameSite=None', 'www-authenticate': 'Key', 'x-kong-request-id': '7a69f75716753f35dedeb246056eb75e', 'x-kong-response-latency': '1' }, responseBody: '{\n' + ' "message":"Unauthorized",\n' + ' "request_id":"7a69f75716753f35dedeb246056eb75e"\n' + '}', isRetryable: false, data: undefined, [Symbol(vercel.ai.error)]: true, [Symbol(vercel.ai.error.AI_APICallError)]: true }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions