From 4feba7f96fa3debad484b3af1652df95010316ae Mon Sep 17 00:00:00 2001 From: Thibault Genaitay Date: Tue, 24 Sep 2024 11:46:15 +0200 Subject: [PATCH 1/2] fix(ai): missing backslash --- ai-data/generative-apis/api-cli/using-chat-api.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai-data/generative-apis/api-cli/using-chat-api.mdx b/ai-data/generative-apis/api-cli/using-chat-api.mdx index c539bdaaab..5241c2e8d3 100644 --- a/ai-data/generative-apis/api-cli/using-chat-api.mdx +++ b/ai-data/generative-apis/api-cli/using-chat-api.mdx @@ -23,7 +23,7 @@ Creates a model response for the given chat conversation. curl --request POST \ --url https://api.scaleway.ai/v1/chat/completions \ --header 'Authorization: Bearer ${SCW_SECRET_KEY}' \ - --header 'Content-Type: application/json' + --header 'Content-Type: application/json' \ --data '{ "model": "llama-3.1-8b-instruct", "messages": [ From 7dbc2039b8f0dad9af78011089698e40b72e2068 Mon Sep 17 00:00:00 2001 From: Thibault Genaitay Date: Tue, 24 Sep 2024 14:42:45 +0200 Subject: [PATCH 2/2] fix(ai): confusion around api key --- ai-data/generative-apis/api-cli/using-generative-apis.mdx | 2 +- ai-data/generative-apis/how-to/query-text-models.mdx | 4 ++-- ai-data/generative-apis/quickstart.mdx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ai-data/generative-apis/api-cli/using-generative-apis.mdx b/ai-data/generative-apis/api-cli/using-generative-apis.mdx index f6c07fc544..fb765b69f0 100644 --- a/ai-data/generative-apis/api-cli/using-generative-apis.mdx +++ b/ai-data/generative-apis/api-cli/using-generative-apis.mdx @@ -20,7 +20,7 @@ dates: All requests to the Scaleway Generative APIs must include an `Authorization` HTTP header with your API key prefixed by `Bearer`. -We recommend exporting your secret key as an environment variable, which you can then pass directly in your curl request as follows. Remember to replace the example value with your own API secret key. +We recommend exporting your secret key as an environment variable, which you can then pass directly in your curl request as follows. Remember to replace the example value with *your own API secret key*. ``` export SCW_SECRET_KEY=720438f9-fcb9-4ebb-80a7-808ebf15314b diff --git a/ai-data/generative-apis/how-to/query-text-models.mdx b/ai-data/generative-apis/how-to/query-text-models.mdx index 96ab508cc9..7194ab4a7d 100644 --- a/ai-data/generative-apis/how-to/query-text-models.mdx +++ b/ai-data/generative-apis/how-to/query-text-models.mdx @@ -54,7 +54,7 @@ from openai import OpenAI # Initialize the client with your base URL and API key client = OpenAI( base_url="https://api.scaleway.ai/v1", # Scaleway's Generative APIs service URL - api_key="" # Your unique API key from Scaleway + api_key="" # Your unique API secret key from Scaleway ) ``` @@ -69,7 +69,7 @@ response = client.chat.completions.create( messages=[{"role": "user", "content": "Describe a futuristic city with advanced technology and green energy solutions."}], temperature=0.2, # Adjusts creativity max_tokens=100, # Limits the length of the output - top_p=0.7 # Controls diversity through nucleus sampling + top_p=0.7 # Controls diversity through nucleus sampling. You usually only need to use temperature. ) # Print the generated response diff --git a/ai-data/generative-apis/quickstart.mdx b/ai-data/generative-apis/quickstart.mdx index c3800bdbef..0eabad417b 100644 --- a/ai-data/generative-apis/quickstart.mdx +++ b/ai-data/generative-apis/quickstart.mdx @@ -55,12 +55,12 @@ pip install openai from openai import OpenAI client = OpenAI( - base_url="https://api.scaleway.ai/v1", - api_key="" + base_url="https://api.scaleway.ai/v1", # # Scaleway's Generative APIs service URL + api_key="" # Your unique API secret key from Scaleway ) ``` -Make sure that you replace `` with the API key obtained from your Scaleway account. +Make sure that you replace `` with the API key obtained from your Scaleway account. It is recommended to store your API keys securely using environment variables or [secret management tools](/identity-and-access-management/secret-manager/) to prevent unauthorized access.