20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 `;
24
41 FROM ${INFERENCE_CALLS_TABLE} i
42 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
43 WHERE u.our_api_token = 1
44 `;
45
1import { renderLayout } from "./layout.ts";
2import { formatNumber, formatPrice, formatDate, formatBoolean } from "../utils/formatters.ts";
3import { CreditAddition } from "../api/credit-additions.ts";
4
5interface UserSummaryRow {
33 finish_reason?: string;
34 num_images?: number;
35 our_api_token: boolean;
36}
37
1import { useState, useEffect } from "react";
2
3const PROJECT_ENDPOINT = "/api/project";
4const FILES_ENDPOINT = "/api/project-files";
5
6export function useProject(projectId: string, branchId?: string) {
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/projects-loader";
4
5export function useProjects() {
8 const fetchBalance = async () => {
9 try {
10 const response = await fetch("/api/credit-balance");
11 if (response.ok) {
12 const data = await response.json();
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/create-project";
4
5export function useCreateProject() {
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/create-branch";
4
5export function useCreateBranch(projectId: string) {
17 project,
18 branchId,
19 // anthropicApiKey,
20 // bearerToken,
21 selectedFiles,
39 status,
40 } = useChat({
41 api: "/api/send-message",
42 body: {
43 project,
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/project-branches";
4
5export function useBranches (projectId: string) {
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
22
129 </div>
130 <div class="card-item">
131 <strong>Our API:</strong> ${formatBoolean(usage.our_api_token)}
132 </div>
133 </div>