Authentification
Obtenir un jeton
Format de l’en-tête
Authorization: Bearer <votre_jeton>Exemples (curl / Python / JavaScript)
curl -sS "https://albert.api.etalab.gouv.fr/v1/models" \
-H "Authorization: Bearer VOTRE_JETON" \
-H "Content-Type: application/json"import os
from openai import OpenAI
client = OpenAI(
base_url="https://albert.api.etalab.gouv.fr/v1",
api_key=os.environ["ALBERT_API_KEY"],
)
models = client.models.list()
print([m.id for m in models.data])import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://albert.api.etalab.gouv.fr/v1",
apiKey: process.env.ALBERT_API_KEY,
});
const models = await client.models.list();
console.log(models.data.map((m) => m.id));Last updated
Was this helpful?