Skip to main content
API key integrations are the simplest way to get started - just provide your API credentials.
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 in Code

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?