Docs

Getting Started

Install the Validakey PHP client and issue your first access token.

Copy for AI

Paste into Cursor, Claude, or another coding agent. It must use the official PHP client — not hand-rolled envelopes.

Integrate Validakey using only validakey/validakey-php.
Fetch https://dev.validakey.com/llms.txt and https://dev.validakey.com/ai/skill/ and follow them.
Set VALIDAKEY_BASE_URL=https://dev.validakey.com/v1, VALIDAKEY_API_UUID, VALIDAKEY_USER_APP_ID.
Do not put VALIDAKEY_API_PKEY in end-user apps. Persist Instance ID.
Implement mint then validate. OpenAPI reference: https://dev.validakey.com/openapi.json

More for AI / coding agents →

Install

composer require validakey/validakey-php

Load Composer’s autoloader in your application bootstrap.

Credentials

From your Validakey account and deployment you will need:

Value Description
Base URL API root, e.g. https://dev.validakey.com/v1
Account UUID Your account identifier (UUIDv4).
App ID Application UUID issued for this integration. It keys the handshake. Keep it private, but it is not a secret — it ships with production code.
Subject ID End-customer id for multi-tenant apps.
Private key Bearer credential for your own account endpoints. Not needed for licences — do not ship it in distributed software.

Configure

use Validakey\ValidakeyClient;
use Validakey\ValidakeyConfig;

$config = new ValidakeyConfig(
    baseUrl: getenv('VALIDAKEY_BASE_URL'),
    apiUUID: getenv('VALIDAKEY_API_UUID'),
    userAppId: getenv('VALIDAKEY_USER_APP_ID'),
    apiPKey: getenv('VALIDAKEY_API_PKEY'), // optional; account path only
    subject: getenv('VALIDAKEY_SUBJECT') ?: null,
);

$client = new ValidakeyClient($config);

Persist the instance id

Token calls authenticate with an instance id obtained through a handshake. By default it lives in memory. For a long-lived process, persist it so concurrent requests do not invalidate each other:

use Validakey\Instance\FileInstanceStore;

$client = new ValidakeyClient(
    $config,
    null,
    new FileInstanceStore('/var/lib/myapp/validakey-instance.json'),
);

Keep that path outside the web root.

Mint a token

use Validakey\CreateTokenRequest;

$token = $client->createToken(
    new CreateTokenRequest(duration: 3600)
);
echo $token->token;

Your account needs a card on file before minting. Monthly dues start when you mint a production vKey. Priced vKeys also require the Instance Entity (end customer) to have a card on file.

Continue with the PHP client →