Mesh API supports both using Mesh API credits (platform credentials) and the option to bring your own provider keys (BYOK).
Using provider keys enables direct control over rate limits and costs via your provider account (e.g., AWS Bedrock, Google Vertex AI).
When you configure a BYOK key, Mesh API securely stores the reference and uses it for requests routed through that provider on your behalf.
By default, requests will use your BYOK key. If your key fails (e.g., due to authentication errors or rate limits), the request will fall back to using Mesh API’s platform credentials, unless you have disabled fallback for that key.
You can control the fallback behavior for each key:
The platform fee is currently 0% for all BYOK requests. You can use your own keys without any additional cost for now.
BYOK is supported for the following providers. Here is what you need to configure each:
For OpenAI, you only need to provide your API key.
You can configure Bedrock using one of two methods:
Method 1: Bedrock API Keys Simply provide your Bedrock API key as a string. Note that these keys are tied to a specific AWS region.
Method 2: AWS Credentials (JSON) Alternatively, you can provide a JSON object with your AWS IAM credentials and region:
Ensure your IAM user or role has permissions for bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream.
To use Vertex AI, you must provide your Google Cloud service account key in JSON format. The key should contain all standard fields, and you can optionally include a "region" field to specify the deployment region (defaults to "global" if omitted).
Example service account key with optional region:
Ensure the service account has the Vertex AI User (roles/aiplatform.user) role or at least the aiplatform.endpoints.predict permission.
If your BYOK requests fail, you can debug the issue by checking the response or viewing logs. Common issues include:
bedrock:InvokeModel).