Overview
The "Nevermined Payments" node integrates with the Nevermined platform to manage AI payments, subscriptions, and access control. Specifically, the Validate Request operation checks whether a given request has valid access rights based on user ID, plan ID, request type, and resource. This validation is useful in scenarios where you want to enforce usage limits, subscription status, or agent-specific permissions before allowing API calls or other resource accesses.
Practical examples include:
- Validating if a user's API call is authorized under their current subscription plan.
- Checking if an AI agent is permitted to access a specific resource endpoint.
- Enforcing credit usage limits for paid plans before processing requests.
Properties
| Name | Meaning |
|---|---|
| Request Parameters | JSON object containing the request details to validate. Must include userId, planId, requestType, and resource fields. Example: { "userId": "user_123", "planId": "plan_456", "requestType": "api_call", "resource": "/api/v1/chat" } |
| Agent ID | Optional string specifying an Agent ID to validate the request against a specific agent. If provided, the validation ensures the request is allowed for this particular agent. Example: "agent_1234567890_abc123" |
Output
The output JSON contains detailed validation results including:
validationId: Unique identifier for the validation event.isValid: Boolean indicating if the request is valid.timestamp: ISO timestamp of when validation occurred.request: Echoes back the validated request parameters, including optionalagentId.validationDetails: Status information about user, plan, credits availability, and optionally agent authorization.- If valid (
isValid: true):accessGranted: Details about granted access such as resource, permissions (e.g., read, write), expiration time, and credits to deduct.usageTracking: Information about credits before and after the request, daily usage, and limits.
- If invalid (
isValid: false):accessDenied: Reason for denial and suggested actions (e.g., purchase more credits).
environment: Indicates the environment used (production or test).message: Human-readable summary of the validation result.
This structure allows downstream nodes or workflows to make informed decisions based on access rights and credit availability.
Dependencies
- Requires an API key credential for the Nevermined Payments API.
- The node uses environment settings from credentials to determine the API base URL (production or testing).
- No additional external dependencies are required beyond the configured API key and network connectivity to Nevermined services.
Troubleshooting
- Invalid JSON in Request Parameters: If the JSON input for request parameters is malformed, the node will throw an error. Ensure the JSON is correctly formatted.
- Missing Required Fields: The request parameters must include
userId,planId,requestType, andresource. Omitting any will cause an error. - No API Key Provided: The node requires a valid API key credential; missing or invalid keys will prevent execution.
- Unauthorized Agent: If an Agent ID is provided but not authorized, the validation will fail with an appropriate message.
- Insufficient Credits: Validation may fail if the user’s plan does not have enough credits for the requested operation.
- Common Error Messages:
"Missing required fields in request parameters: ..."— Add the missing fields."Invalid JSON in Request Parameters: ..."— Fix JSON syntax errors."No API Key provided!"— Configure the API key credential properly."Request validation failed. Access denied."— Check user, plan, credits, and agent authorization.
Links and References
- Nevermined Documentation - Official docs for the Nevermined platform and API.
- Node's documentation URL (from metadata): https://docs.nevermined.io