A valid ABC file must contain - on separate lines - "X:1" (or some other number) followed by "T:xxx" (where xxx is the tune title) and then somewhere before the actual notes, "K:x" (where x is the key signature).
Please see the ABC specification at abcnotation.com/wiki/abc:standard:v2.1#information_field_definition