Connect a coding tool or server-side application to a Veryfront project. The project's AI policy, key limits, and credits apply to requests made with its key.
1. Create or open a project
At Projects, open the project you want to use. To create one, select New project, then Start from scratch, enter a name, and select Create Project. Studio opens the project workspace.
2. Create and save a project key
- In the workspace's panel picker, open API Keys.
- Select Create API key and give the key a name identifying its client or owner.
- Keep Read enabled for model discovery and enable Write for inference. The form defaults to Read only. Leave Delete off unless the client needs it.
- Select Create API Key. Copy the secret from API key created and save it. The secret is shown once.
- Select Connect to the AI gateway to open this guide in a new tab, then select Done in the key dialog.
Store the key in a secret manager or a local environment file excluded from source control. Use a separate key for each developer or application so it can be revoked independently. Keep keys out of browser bundles and published configuration.
The examples use placeholders. In your local terminal, export the saved key:
Project keys identify their project automatically. These examples require no project-selector header. An account-level key follows the separate authentication guide.
3. Discover a model
List the models your project key can access:
Use a returned ID rather than guessing a model name. Choose a model supporting the client's request format. For the examples below, replace <openai-model-id> with a Responses-capable OpenAI model and <claude-model-id> with an available Claude model. Clients using Chat Completions need a model supporting that format. A model listed for a project is not a guarantee that every client protocol or hosted tool works with it.
If the list is empty, check the project policy and key limits before configuring the client.
4. Configure your client
Use the tab for your installed client. Replace the model placeholders with the IDs selected above and the key placeholder with your saved project key.
Run these variables in the terminal that starts Claude Code. The /model picker uses gateway discovery. Claude Code uses Claude models through the Anthropic Messages format. Its base URL is /ai because the client appends /v1/messages.
Application SDKs
For server-side application code, use the same project key and returned model ID. Install the SDK shown in the selected tab, save its .mts TypeScript example, and run it with npx tsx <filename>. The .mts extension supports top-level await in existing CommonJS projects as well as ESM projects.
The endpoint prefix depends on the SDK: OpenAI clients use /ai/v1, the official Anthropic SDK uses /ai, and the Vercel Anthropic provider uses /ai/v1. Native Google clients use /ai/gateway/google. Do not substitute one prefix for every SDK.
See the official OpenAI SDK documentation for SDK installation and response handling. The credential and endpoint here belong to Veryfront.
Veryfront Code applications
For a Veryfront Code application, follow Code getting started and its model/provider configuration. The framework CLI's login and linked-project flow remain separate from the direct gateway-key configuration above. A project API key does not replace veryfront login.
5. Verify one request
In your configured client, send: Reply with gateway connected. Confirm that it returns an answer without an authentication, model, or policy error. The request consumes project credits.
For an HTTP-level check of a Responses-capable model, run:
Expect an assistant answer. If the request fails, read its error body before retrying:
Model discovery verifies Read access. A successful inference request verifies the client setup. Check the project key's usage after the test.
Next
- API Keys in Studio: Rotate or revoke the client key and inspect usage.
- Create an API key: Manage credentials for other API clients.
Related
- Authenticate API requests: Bearer credentials and resource access.
- AI Gateway API: Request formats, model discovery, and project policy.
- Codex configuration: Local Codex settings, including hosted web search.