---
title: Filtrer les arguments envoyés au fournisseur d&rsquo;IA pour générer des métadonnées sociales
url: "https://www.seopress.org/fr/support/hooks/filtrer-les-arguments-envoyes-au-fournisseur-dia-pour-generer-des-metadonnees-sociales/"
lang: fr-FR
updated: 2026-03-10
hook_name: seopress_ai_{provider}_social_request_args
required_version: 9.5
---

# Filtrer les arguments envoyés au fournisseur d&rsquo;IA pour générer des métadonnées sociales

- **Hook name:** `seopress_ai_{provider}_social_request_args`
- **Required version:** 9.5

```php
<?php
add_filter( 'seopress_ai_openai_social_request_args', 'sp_ai_openai_social_request_args' );
function sp_ai_openai_social_request_args( $args ) {
    // Example: increase the timeout if your answers are long.
    $args['timeout'] = 45;
    // Example: adding/overriding a custom header.
    if ( ! isset( $args['headers'] ) || ! is_array( $args['headers'] ) ) {
        $args['headers'] = [];
    }
    $args['headers']['X-My-Project'] = 'my-seopress-ai-integration';
    // Example: force the language in the JSON body, if necessary.
    if ( isset( $args['body'] ) && is_string( $args['body'] ) ) {
        $body = json_decode( $args['body'], true );
        if ( json_last_error() === JSON_ERROR_NONE && is_array( $body ) ) {
            $body['user_locale'] = get_locale(); // e.g. "fr_FR"
            $args['body']        = wp_json_encode( $body );
        }
    }
    return $args;
}
```

Source: [https://gist.github.com/wp-seopress/bcaa0f07c3038ab8f8f2fc0e8ffa9632](https://gist.github.com/wp-seopress/bcaa0f07c3038ab8f8f2fc0e8ffa9632)


 

Remplacez `{provider}` par le nom du fournisseur d’IA :

- openai
- deepseek
- gemini
- mistral
- claude
