Skip to content

AI Providers and Endpoints

This reference covers WP Career Board Pro 1.4.3.

The AI hiring tools (applicant ranking, fit scores, applicant TL;DR summaries, candidate-to-job matching, AI job-description and cover-letter writing) live in modules/ai/. They are driver-based: one driver per provider, all behind a common interface, with a filter to register a fourth provider from an addon.

Built-in providers: Anthropic Claude, OpenAI, and self-hosted Ollama. Providers are chosen per task - an analysis and ranking provider (Claude, OpenAI, or Ollama) and an embedding/matching provider (OpenAI or Ollama) - each with its own key, under Settings > AI Settings.

All AI routes live under the shared wcb/v1 namespace and are registered by api/endpoints/class-ai-endpoint.php. Every route is gated by the Pro REST permission wrapper plus a capability check (license never gates them - see the licensing note below).

Method Route Permission Purpose
POST /wcb/v1/ai/match logged in Score how well a resume matches a job.
GET /wcb/v1/candidates/{id}/matches own or admin “Recommended for you” jobs for a candidate (needs an embedding provider).
GET /wcb/v1/ai/ranked-applications/{job_id} can view that job’s applications AI-ranked applicant list for a job, best fit first.
POST /wcb/v1/jobs/ai-description can post jobs Generate a job description.
POST /wcb/v1/jobs/{job_id}/ai-cover-letter logged in Generate a tailored cover letter from the candidate’s resume and the job.

Fit scores, reasons, and summaries are cached per application (in the _wcbp_ai_fit_score, _wcbp_ai_fit_reason, and _wcbp_ai_summary meta family), so re-opening the Employer Dashboard never re-bills the model; ranking computes only what is missing.

When “Auto-score applicants on submit” is enabled (Settings > AI Settings, option wcbp_ai_auto_rank), Pro schedules a single cron event to score each new application in the background:

wp_schedule_single_event( time() + 30, 'wcbp_ai_score_application', array( $app_id ) );

The handler AI_Module::run_scheduled_scoring() listens on the wcbp_ai_score_application action. To trigger scoring yourself, fire that action with an application id.

Every provider implements AiDriverInterface (modules/ai/class-ai-driver-interface.php):

interface AiDriverInterface {
public function embed( string $text ): array|\WP_Error; // vector for matching
public function complete( string $prompt ): string|\WP_Error; // text generation
public function provider_name(): string;
}

The built-in drivers are ClaudeDriver, OpenAiDriver, and OllamaDriver, all in modules/ai/.

The driver registry is a provider_slug => factory_callable map run through the wcbp_ai_provider_drivers filter. Add a slug to ship your own provider:

add_filter( 'wcbp_ai_provider_drivers', function ( array $drivers, string $credential ) {
$drivers['my_llm'] = static function () use ( $credential ): \WCB\Pro\Modules\Ai\AiDriverInterface {
return new \MyAddon\Ai\MyLlmDriver( $credential );
};
return $drivers;
}, 10, 2 );

Then make your provider selectable by registering it in the AI settings UI, or set the relevant option (wcbp_ai_completion_provider / wcbp_ai_embedding_provider) to your slug.

If your provider does not need an API key (for example a self-hosted endpoint), tell Pro via the wcbp_ai_provider_requires_api_key filter:

add_filter( 'wcbp_ai_provider_requires_api_key', function ( bool $requires, string $provider ) {
return 'my_llm' === $provider ? false : $requires;
}, 10, 2 );

Each provider’s model is configurable so you can trade quality for cost. For Claude, the model is resolved through the wcbp_ai_claude_model filter (default reads the wcbp_ai_anthropic_model option). To force a model:

add_filter( 'wcbp_ai_claude_model', fn() => 'claude-3-5-haiku-latest' );
Filter Args Use to
wcbp_candidate_resume_data $user_id Override the grouped resume data Pro feeds the model when scoring or matching a candidate. Connecting this is what makes fit scores real instead of zero.
wcbp_ai_candidate_matches $matches, $user_id Post-process the candidate match results before they are returned.
wcbp_ai_ranked_applications $ranked, $job_id Post-process the applicant ranking before it is returned.

Like every Pro feature, the AI tools are not gated on the license. The license drives automatic updates only; once Pro is installed and a provider key is set, the AI endpoints work regardless of license status. See 02-extending-free.md for the contract.