Skip to main content
API key integrations use a single set of credentials for your entire application. Perfect for services like search APIs (Exa, Tavily) where you don’t need user-specific authorization—just get an API key, deploy, and start building.
What you’ll learn:
  • How to deploy API key-based integrations
  • How to configure and test integrations
Related resources:

Deploying an API Key Integration

1

Get Your API Key

Sign up for the service (e.g., Exa, Tavily) and generate an API key.
2

Find Integration

In Metorial, go to Servers and search for the integration.
3

Create Deployment

Click Deploy, name your deployment, and paste your API key.
4

Test

Use the test console to verify the deployment works.

Using API Key Integrations

After deploying your integration, pass the deployment ID to your Metorial session. The integration handles authentication automatically using the API key you configured.
import { Metorial } from 'metorial';
import { metorialAiSdk } from '@metorial/ai-sdk';
import { anthropic } from '@ai-sdk/anthropic';
import { streamText } from 'ai';

let metorial = new Metorial({
    apiKey: process.env.METORIAL_API_KEY
});

await metorial.withProviderSession(
    metorialAiSdk,
    {
        serverDeployments: [
            { serverDeploymentId: 'your-exa-deployment-id' }
        ],
        streaming: true
    },
    async ({ tools, closeSession }) => {
        let result = streamText({
            model: anthropic('claude-sonnet-4-5'),
            prompt: 'Search for AI news',
            tools: tools,
            onFinish: async () => await closeSession()
        });

        for await (let text of result.textStream) {
            process.stdout.write(text);
        }
    }
);

What’s Next?