Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=api&page=16&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 11489 results for "api"(1069ms)

myApi1 file match

@emohamed•Updated 1 year ago

myApi1 file match

@itsfiggers•Updated 1 year ago

myApi1 file match

@jmelis•Updated 1 year ago

myApi1 file match

@markm247•Updated 1 year ago

myApi1 file match

@fdurham•Updated 1 year ago

myApi1 file match

@conanak99•Updated 1 year ago

myApi1 file match

@cganoo•Updated 1 year ago

myApi1 file match

@gugge•Updated 1 year ago

myApi1 file match

@amirmasoudabdol•Updated 1 year ago

myApi1 file match

@charlesfrisbee•Updated 1 year ago

untitled-2604new-file-9513.tsx24 matches

@al0•Updated 1 hour ago
1// Creado por Alfonso Boldo
2// Sistema de Prueba de APIs de LLMs para ValTown
3// Fecha: 05 de mayo de 2025
4
5// Este sistema permite probar distintas APIs de LLMs como ChatGPT (OpenAI) y Claude (Anthropic)
6// Puede implementarse en ValTown como un endpoint HTTP
7
26
27 // Extraer parámetros
28 const { provider, apiKey, prompt, model, temperature, maxTokens } = body;
29
30 // Validar parámetros requeridos
31 if (!provider || !apiKey || !prompt) {
32 return new Response(
33 JSON.stringify({
34 error: 'Se requieren los parámetros: provider, apiKey y prompt'
35 }),
36 { status: 400, headers }
43 switch (provider.toLowerCase()) {
44 case 'openai':
45 result = await callOpenAI(apiKey, prompt, model || 'gpt-4o', temperature || 0.7, maxTokens || 1000);
46 break;
47 case 'anthropic':
48 result = await callClaude(apiKey, prompt, model || 'claude-3-5-sonnet-20240521', temperature || 0.7, maxTokens || 1000);
49 break;
50 default:
73}
74
75// Función para llamar a la API de OpenAI
76async function callOpenAI(apiKey, prompt, model, temperature, maxTokens) {
77 const url = 'https://api.openai.com/v1/chat/completions';
78
79 const response = await fetch(url, {
81 headers: {
82 'Content-Type': 'application/json',
83 'Authorization': `Bearer ${apiKey}`
84 },
85 body: JSON.stringify({
108}
109
110// Función para llamar a la API de Claude (Anthropic)
111async function callClaude(apiKey, prompt, model, temperature, maxTokens) {
112 const url = 'https://api.anthropic.com/v1/messages';
113
114 const response = await fetch(url, {
116 headers: {
117 'Content-Type': 'application/json',
118 'x-api-key': apiKey,
119 'anthropic-version': '2023-06-01'
120 },
153 <meta charset="UTF-8">
154 <meta name="viewport" content="width=device-width, initial-scale=1.0">
155 <title>Probador de APIs de LLMs</title>
156 <style>
157 body {
232 </head>
233 <body>
234 <h1>Probador de APIs de LLMs</h1>
235 <p>Esta herramienta te permite probar diferentes APIs de modelos de lenguaje como OpenAI (ChatGPT) y Claude (Anthropic).</p>
236
237 <div class="container">
245
246 <div class="form-group">
247 <label for="apiKey">API Key:</label>
248 <input type="password" id="apiKey" placeholder="Ingresa tu API key aquí">
249 </div>
250
353 submitBtn.addEventListener('click', async () => {
354 const provider = document.getElementById('provider').value;
355 const apiKey = document.getElementById('apiKey').value;
356 const model = document.getElementById('model').value;
357 const temperature = parseFloat(document.getElementById('temperature').value);
360
361 // Validar campos
362 if (!apiKey || !prompt) {
363 alert('Por favor completa todos los campos requeridos.');
364 return;
371
372 // URL del endpoint (reemplaza con la URL real de tu Val en ValTown)
373 const endpointUrl = 'https://api.val.town/v1/run/tu-usuario/llm-api-tester';
374
375 // Enviar solicitud
381 body: JSON.stringify({
382 provider,
383 apiKey,
384 prompt,
385 model,

morningmailmain.tsx1 match

@flymaster•Updated 1 hour ago
11async function wikitext(): string {
12 const randomArticle = await fetch(
13 "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&exintro&explaintext&redirects=1&generator=random&formatversion=2&grnnamespace=0&grnlimit=3",
14 );
15 const articleJson = await randomArticle.json();
apiv1
papimark21