PromptRails

Credentials

Store provider keys, database connections, and tool secrets once, then reuse them safely across the workspace.

Credentials store the API keys, connection strings, OAuth tokens, and secrets PromptRails needs to call models, databases, media providers, and external tools. They belong to a workspace, are encrypted at rest, and are never returned in API responses.

If you use PromptRails-hosted models through the LLM Gateway, you do not need to add a provider credential for those models. Credentials are still used for bring-your-own-key providers, databases, media tools, and external services.

The credentials list shows workspace-level provider keys and database connections, including connection status and schema availability.

When You Need a Credential

Add a credential when PromptRails needs to call something owned by your team:

  • A model provider account your company controls
  • A database or warehouse used by a data source
  • A tool secret, OAuth token, SMTP server, or external API key
  • A media provider used by an agent tool

After a credential is created, agents, prompts, data sources, tools, and media workflows can reference it without exposing the raw secret to users or API responses.

Choosing the Right Type

Start from the product question, not the provider list:

  • Need model access with your own vendor account? Add an LLM provider credential.
  • Need agents to query company data? Add a data warehouse credential, then attach it to a data source in Studio.
  • Need a specific tool secret? Configure it from the tool in Studio, because tool credentials belong to that tool setup.
  • Need hosted models without managing provider keys? Use the LLM Gateway instead of adding a provider key.
Technical detailsCredential type reference

Credential Categories

Credentials are organized by what they connect to:

LLM Credentials

Connect to LLM providers for prompt execution and agent orchestration.

ProviderType IdentifierDescription
OpenAIopenaiGPT-4, GPT-4o, GPT-3.5, etc.
AnthropicanthropicClaude 3.5, Claude 3, etc.
Google GeminigeminiGemini Pro, Gemini Ultra, etc.
DeepSeekdeepseekDeepSeek chat and code models
FireworksfireworksFireworks AI hosted models
xAIxaiGrok models
OpenRouteropenrouterMulti-provider routing
Together AItogether_aiTogether AI hosted models
MistralmistralMistral AI models
CoherecohereCohere command and embed models
GroqgroqGroq high-speed inference
PerplexityperplexitySearch-augmented Sonar models
AWS BedrockbedrockClaude, Llama, Nova & more on AWS
CerebrascerebrasCerebras high-speed inference
SambaNovasambanovaSambaNova hosted models
HyperbolichyperbolicHyperbolic hosted models
DeepInfradeepinfraDeepInfra hosted models
Novita AInovitaNovita AI hosted models
Friendli AIfriendliFriendli AI hosted models
Chutes AIchutesChutes AI hosted models
Z.AIzaiZ.AI (GLM) models
MoonshotmoonshotMoonshot (Kimi) models
DashScopedashscopeAlibaba DashScope (Qwen) models
Hugging FacehuggingfaceHugging Face Router models

AWS Bedrock uses AWS Signature V4 rather than a single API key. When you add a bedrock credential, supply an Access Key ID, Secret Access Key and Region (plus an optional Session Token for temporary/STS credentials) instead of one key string.

Not every provider supports every feature — see Prompts for how reasoning, web search, prompt caching, and structured output appear in prompt settings.

Speech Credentials

Connect to speech providers for text-to-speech and speech-to-text.

ProviderType IdentifierDescription
ElevenLabselevenlabsHigh-quality TTS voices
DeepgramdeepgramTTS and STT with Nova models
OpenAI Audioopenai_audioOpenAI TTS (tts-1) and Whisper STT

Image Credentials

Connect to image generation and editing providers.

ProviderType IdentifierDescription
FalfalFast image generation (FLUX, SD)
ReplicatereplicateRun open-source models
Stability AIstabilityStable Diffusion models
OpenAI Imageopenai_imageDALL-E 3 and DALL-E 2

Video Credentials

Connect to video generation providers.

ProviderType IdentifierDescription
RunwayrunwayGen-3 Alpha video generation
PikapikaAI video generation
LumalumaDream Machine video generation

Data Warehouse Credentials

Connect to databases for data source queries.

DatabaseType IdentifierDescription
PostgreSQLpostgresqlPostgreSQL connection string
MySQLmysqlMySQL connection string
BigQuerybigqueryGoogle BigQuery service account
SnowflakesnowflakeSnowflake account credentials
RedshiftredshiftAmazon Redshift connection
MSSQLmssqlMicrosoft SQL Server
ClickHouseclickhouseClickHouse connection
Static Filestatic_fileFile-based data access

Tool Credentials

Credentials for external APIs and services used by MCP tools.

TypeDescription
api_keyGeneric API key authentication
oauthOAuth token-based authentication
databaseGeneric database connection (with schema_type required)
smtpSMTP server credentials

Creating Credentials

Create credentials from workspace settings for normal setup. Use SDK calls when an internal platform needs to provision or rotate credentials programmatically.

Technical detailsCreate and manage credentials with SDKs

Python SDK

# LLM credential
credential = client.credentials.create(
    name="OpenAI Production",
    category="llm",
    type="openai",
    value="sk-proj-your-openai-api-key",
    description="Production OpenAI API key"
)
 
# Data warehouse credential
db_credential = client.credentials.create(
    name="Analytics Database",
    category="data_warehouse",
    type="postgresql",
    value="postgresql://user:password@host:5432/analytics",
    description="Read-only analytics database"
)
 
# Speech credential
speech_credential = client.credentials.create(
    name="ElevenLabs Production",
    category="speech",
    type="elevenlabs",
    value="your-elevenlabs-api-key",
    description="ElevenLabs TTS API key"
)
 
# Tool credential
tool_credential = client.credentials.create(
    name="Slack Bot Token",
    category="tools",
    type="api_key",
    value="xoxb-your-slack-bot-token",
    description="Slack bot for notifications"
)

JavaScript SDK

const credential = await client.credentials.create({
  name: 'OpenAI Production',
  category: 'llm',
  type: 'openai',
  value: 'sk-proj-your-openai-api-key',
  description: 'Production OpenAI API key',
})

Default Credentials

You can mark one credential per type as the default. Default credentials are automatically used when no specific credential is specified:

client.credentials.set_default(credential_id="your-credential-id")

When an agent or prompt references a model from a provider (e.g., OpenAI), PromptRails uses the default credential for that provider type unless overridden.

Connection Validation

Validate that a credential can successfully connect to its target service:

result = client.credentials.validate(credential_id="your-credential-id")
print(f"Valid: {result['data']['is_valid']}")

Validation checks vary by credential type:

  • LLM credentials: Makes a lightweight API call to verify the key
  • Database credentials: Attempts a connection and basic query
  • Tool credentials: Depends on the tool configuration

Schema Discovery

For data warehouse credentials, PromptRails can discover the database schema (tables, columns, types):

# Trigger schema discovery
client.credentials.discover_schema(credential_id="your-credential-id")
 
# Get the discovered schema
credential = client.credentials.get(credential_id="your-credential-id")
if credential["data"]["has_schema"]:
    print(f"Schema updated: {credential['data']['schema_updated_at']}")

The discovered schema includes:

  • Table names
  • Column names and data types
  • Nullability
  • Default values
  • Descriptions (where available)

This schema information helps agents understand the database structure when constructing queries.

Technical detailsCredential API details

Credential Response

API responses include a safe representation of credentials (never the raw value):

FieldDescription
idUnique credential identifier
nameDisplay name
typeProvider or database type
categoryllm, speech, image, video, data_warehouse, or tools
descriptionOptional description
masked_contentMasked credential value (e.g., sk-pr...abcd)
is_defaultWhether this is the default for its type
is_validWhether the last validation check passed
has_schemaWhether schema information is available
schema_updated_atWhen the schema was last discovered
created_atCreation timestamp
updated_atLast update timestamp

Updating Credentials

When you update a credential, the new value is encrypted and stored. The previous value cannot be recovered.

client.credentials.update(
    credential_id="your-credential-id",
    value="new-api-key-value",
    name="Updated Name"
)

Deleting Credentials

Credentials are soft-deleted. Deleting a credential does not affect historical execution traces but will prevent future use.

client.credentials.delete(credential_id="your-credential-id")
  • Assets and Media -- Using credentials for speech, image, and video tools
  • Data Sources -- Using credentials for database queries
  • LLM Gateway -- Calling hosted models without adding a provider key
  • MCP Tools -- Using credentials for tool authentication
  • Security -- Encryption and security practices