- Python
- Node.js
Each route is a method of the client, and its request body is built from the models in
weflayr.openapi.models.import weflayr
from weflayr.openapi.models import CostsInput
client = weflayr.client() # reads WEFLAYR_API_KEY
costs = client.get_costs(body=CostsInput.from_dict({"date_from": "2026-06-01", "group_by": "feature"}))
Each route is a function of
weflayr.api taking the client, with camelCase keys. It returns { data, error }, or throws on an error with throwOnError: true.const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
const { data } = await weflayr.api.getCosts({
client,
throwOnError: true,
body: { dateFrom: '2026-06-01', groupBy: 'feature' },
});
Routes
| Route | Python | Node.js |
|---|---|---|
| Dashboard data | ||
| Get costs | get_costs | getCosts |
| Get margin (revenue-linked projects) | get_margin | getMargin |
| Get performance (internal projects) | get_performance | getPerformance |
| Revenue (revenue-linked projects) | ||
| Set revenue | set_revenue | setRevenue |
| Get revenue | get_revenue | getRevenue |
| Delete revenue | delete_revenue | deleteRevenue |
| Key metrics (internal projects) | ||
| Set key metrics | set_key_metrics | setKeyMetrics |
| Get key metrics | get_key_metrics | getKeyMetrics |
| Delete key metrics | delete_key_metrics | deleteKeyMetrics |
| Customer tags | ||
| Set customer tags | set_customers_tags | setCustomersTags |
| Get customer tags | get_customers_tags | getCustomersTags |
| Delete customer tags | delete_customers_tags | deleteCustomersTags |
| Project | ||
| Get project | get_project | getProject |
| Get tags | get_tags | getTags |
| Get models | get_models | getModels |
| Get providers | get_providers | getProviders |
| Get customers | get_customers | getCustomers |
| Get features | get_features | getFeatures |
| Calls | ||
| Get calls | get_calls | getCalls |
| Evaluators | ||
| Get evaluators | get_evaluators | getEvaluators |
| Get evaluator | get_evaluator | getEvaluator |
| Set evaluator | set_evaluator | setEvaluator |
| Delete evaluator | delete_evaluator | deleteEvaluator |
| Generate evaluators | generate_evaluators | generateEvaluators |
| Test evaluator | test_evaluator | testEvaluator |
| Benchmarks | ||
| Get benchmark candidates | get_benchmark_candidates | getBenchmarkCandidates |
| Get benchmarks | get_benchmarks | getBenchmarks |
| Get benchmark | get_benchmark | getBenchmark |
| Set benchmark | set_benchmark | setBenchmark |
| Delete benchmark | delete_benchmark | deleteBenchmark |
| Get benchmark examples | get_benchmark_examples | getBenchmarkExamples |
| Start or resume benchmark | start_or_resume_benchmark | startOrResumeBenchmark |
| Stop benchmark | stop_benchmark | stopBenchmark |
| Import past data | import_past_data | importPastData |
| Routing strategies | ||
| Get routing strategies | get_routing_strategies | getRoutingStrategies |
| Get routing strategy | get_routing_strategy | getRoutingStrategy |
| Set routing strategy | set_routing_strategy | setRoutingStrategy |
| Archive routing strategy | archive_routing_strategy | archiveRoutingStrategy |
| Restore routing strategy | restore_routing_strategy | restoreRoutingStrategy |
| Get routing strategy results | get_routing_strategy_results | getRoutingStrategyResults |