# Format natif Claude

Source: https://docs.aicentos.com/fr/api/chat/claude

Language: fr

Chat

`POST /messages`

## Authentification

Stockez votre clé API dans `AICENTOS_API_KEY` ; les exemples shell utilisent sa valeur dans l’en-tête `Authorization: Bearer`.

Clé API obtenue dans la console, section « Gestion des jetons »

Emplacement : `header`

## Corps de requête

`application/json`

Définition des types TypeScript

Utiliser le type de corps de requête dans TypeScript

## Corps de réponse

###

`application/json`

###

`application/json`

###

`application/json`

```bash
export AICENTOS_API_KEY="sk-your-aicentos-api-key"

curl -X POST "https://aicentos.com/v1/messages" \
  -H "Authorization: Bearer $AICENTOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{    "model": "claude-sonnet-4-6",    "max_tokens": 256,    "messages": [      {        "role": "user",        "content": "Présente-toi en une phrase"      }    ]  }'
```

```bash
{
  "id": "string",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "string"
    }
  ],
  "model": "string",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  }
}
```

```bash
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
```

```bash
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
```